Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
garethcastillo_reading
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gareth Xerxes Yap Castillo
garethcastillo_reading
Commits
0673b47e
Commit
0673b47e
authored
Mar 28, 2023
by
Gareth Xerxes Yap Castillo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Populate models
parent
036c60a4
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
60 additions
and
3 deletions
+60
-3
models.cpython-39.pyc
...tillo_reading/bookshelf/__pycache__/models.cpython-39.pyc
+0
-0
0002_alter_books_blurb.py
...lo_reading/bookshelf/migrations/0002_alter_books_blurb.py
+18
-0
0003_alter_books_isbn.py
...llo_reading/bookshelf/migrations/0003_alter_books_isbn.py
+19
-0
0004_alter_books_isbn.py
...llo_reading/bookshelf/migrations/0004_alter_books_isbn.py
+20
-0
0002_alter_books_blurb.cpython-39.pyc
...rations/__pycache__/0002_alter_books_blurb.cpython-39.pyc
+0
-0
0003_alter_books_isbn.cpython-39.pyc
...grations/__pycache__/0003_alter_books_isbn.cpython-39.pyc
+0
-0
0004_alter_books_isbn.cpython-39.pyc
...grations/__pycache__/0004_alter_books_isbn.cpython-39.pyc
+0
-0
models.py
garethcastillo_reading/bookshelf/models.py
+3
-3
db.sqlite3
garethcastillo_reading/db.sqlite3
+0
-0
No files found.
garethcastillo_reading/bookshelf/__pycache__/models.cpython-39.pyc
View file @
0673b47e
No preview for this file type
garethcastillo_reading/bookshelf/migrations/0002_alter_books_blurb.py
0 → 100644
View file @
0673b47e
# Generated by Django 4.1.6 on 2023-03-28 11:38
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bookshelf'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'books'
,
name
=
'blurb'
,
field
=
models
.
TextField
(
default
=
''
,
max_length
=
400
),
),
]
garethcastillo_reading/bookshelf/migrations/0003_alter_books_isbn.py
0 → 100644
View file @
0673b47e
# Generated by Django 4.1.6 on 2023-03-28 11:41
import
django.core.validators
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bookshelf'
,
'0002_alter_books_blurb'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'books'
,
name
=
'isbn'
,
field
=
models
.
PositiveBigIntegerField
(
validators
=
[
django
.
core
.
validators
.
MinLengthValidator
(
13
),
django
.
core
.
validators
.
MaxLengthValidator
(
13
)]),
),
]
garethcastillo_reading/bookshelf/migrations/0004_alter_books_isbn.py
0 → 100644
View file @
0673b47e
# Generated by Django 4.1.6 on 2023-03-28 11:46
import
django.core.validators
from
django.db
import
migrations
,
models
import
re
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bookshelf'
,
'0003_alter_books_isbn'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'books'
,
name
=
'isbn'
,
field
=
models
.
CharField
(
default
=
'0000000000000'
,
max_length
=
13
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
re
.
compile
(
'^
\\
d+(?:
\\
d+)*
\\
Z'
),
code
=
'invalid'
,
message
=
None
),
django
.
core
.
validators
.
MinLengthValidator
(
13
)]),
),
]
garethcastillo_reading/bookshelf/migrations/__pycache__/0002_alter_books_blurb.cpython-39.pyc
0 → 100644
View file @
0673b47e
File added
garethcastillo_reading/bookshelf/migrations/__pycache__/0003_alter_books_isbn.cpython-39.pyc
0 → 100644
View file @
0673b47e
File added
garethcastillo_reading/bookshelf/migrations/__pycache__/0004_alter_books_isbn.cpython-39.pyc
0 → 100644
View file @
0673b47e
File added
garethcastillo_reading/bookshelf/models.py
View file @
0673b47e
from
django.db
import
models
from
django.db
import
models
from
django.core.validators
import
MinValueValidator
,
MaxValueValidator
from
django.core.validators
import
MinValueValidator
,
MaxValueValidator
,
MinLengthValidator
,
MaxLengthValidator
,
int_list_validator
import
datetime
import
datetime
class
Author
(
models
.
Model
):
class
Author
(
models
.
Model
):
...
@@ -19,8 +19,8 @@ class Books(models.Model):
...
@@ -19,8 +19,8 @@ class Books(models.Model):
author
=
models
.
ForeignKey
(
Author
,
on_delete
=
models
.
PROTECT
)
author
=
models
.
ForeignKey
(
Author
,
on_delete
=
models
.
PROTECT
)
publisher
=
models
.
CharField
(
max_length
=
200
,
default
=
default_string
)
publisher
=
models
.
CharField
(
max_length
=
200
,
default
=
default_string
)
year_published
=
models
.
IntegerField
(
validators
=
[
MaxValueValidator
(
datetime
.
datetime
.
now
()
.
year
)],
default
=
datetime
.
datetime
.
now
()
.
year
)
year_published
=
models
.
IntegerField
(
validators
=
[
MaxValueValidator
(
datetime
.
datetime
.
now
()
.
year
)],
default
=
datetime
.
datetime
.
now
()
.
year
)
isbn
=
models
.
IntegerField
(
validators
=
[
MinValueValidator
(
1
),
MaxValueValidator
(
9999999999999
)],
default
=
0
)
isbn
=
models
.
CharField
(
max_length
=
13
,
validators
=
[
int_list_validator
(
sep
=
''
),
MinLengthValidator
(
13
),],
default
=
'0000000000000'
)
blurb
=
models
.
TextField
(
max_length
=
2
00
,
default
=
default_string
)
blurb
=
models
.
TextField
(
max_length
=
4
00
,
default
=
default_string
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
title
)
return
'{}'
.
format
(
self
.
title
)
garethcastillo_reading/db.sqlite3
View file @
0673b47e
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment