Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lance_santuyo_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
Lance Dominic B. Santuyo
lance_santuyo_reading
Commits
a644f269
Commit
a644f269
authored
Mar 28, 2023
by
Lance Dominic B. Santuyo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the Author and Books models
parent
202d608a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
models.py
lance_santuyo_reading/bookshelf/models.py
+16
-1
No files found.
lance_santuyo_reading/bookshelf/models.py
View file @
a644f269
from
django.db
import
models
# Create your models here.
class
Author
(
models
.
Model
):
first_name
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
last_name
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
age
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
nationality
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
bio
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
class
Book
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
course
=
models
.
ForeignKey
(
Author
,
on_delete
=
models
.
CASCADE
,
null
=
True
)
publisher
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
year_published
=
models
.
DateField
(
max_length
=
255
,
blank
=
True
,
null
=
True
)
ISBN
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
blurb
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
\ No newline at end of file
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