Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
migs_atienza_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
Migs Atienza
migs_atienza_reading
Commits
367e8a1c
Commit
367e8a1c
authored
Mar 28, 2023
by
Migs Atienza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 10 data to models
parent
405d7eb9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
1 deletion
+20
-1
admin.cpython-39.pyc
...tienza_reading/bookshelf/__pycache__/admin.cpython-39.pyc
+0
-0
models.cpython-39.pyc
...ienza_reading/bookshelf/__pycache__/models.cpython-39.pyc
+0
-0
admin.py
migs_atienza_reading/bookshelf/admin.py
+13
-0
models.py
migs_atienza_reading/bookshelf/models.py
+7
-1
db.sqlite3
migs_atienza_reading/db.sqlite3
+0
-0
No files found.
migs_atienza_reading/bookshelf/__pycache__/admin.cpython-39.pyc
View file @
367e8a1c
No preview for this file type
migs_atienza_reading/bookshelf/__pycache__/models.cpython-39.pyc
View file @
367e8a1c
No preview for this file type
migs_atienza_reading/bookshelf/admin.py
View file @
367e8a1c
from
django.contrib
import
admin
from
django.contrib
import
admin
from
.models
import
Author
,
Book
class
AuthorAdmin
(
admin
.
ModelAdmin
):
model
=
Author
class
BookAdmin
(
admin
.
ModelAdmin
):
model
=
Book
# Register your models here.
# Register your models here.
admin
.
site
.
register
(
Author
,
AuthorAdmin
)
admin
.
site
.
register
(
Book
,
BookAdmin
)
migs_atienza_reading/bookshelf/models.py
View file @
367e8a1c
...
@@ -8,6 +8,9 @@ class Author(models.Model):
...
@@ -8,6 +8,9 @@ class Author(models.Model):
nationality
=
models
.
CharField
(
max_length
=
100
)
nationality
=
models
.
CharField
(
max_length
=
100
)
bio
=
models
.
CharField
(
max_length
=
700
)
bio
=
models
.
CharField
(
max_length
=
700
)
def
__str__
(
self
):
return
'{} {}'
.
format
(
self
.
first_name
,
self
.
last_name
)
class
Book
(
models
.
Model
):
class
Book
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
100
)
title
=
models
.
CharField
(
max_length
=
100
)
...
@@ -15,6 +18,9 @@ class Book(models.Model):
...
@@ -15,6 +18,9 @@ class Book(models.Model):
publisher
=
models
.
CharField
(
max_length
=
100
)
publisher
=
models
.
CharField
(
max_length
=
100
)
year_published
=
models
.
DateField
()
year_published
=
models
.
DateField
()
ISBN
=
models
.
IntegerField
()
ISBN
=
models
.
IntegerField
()
blurb
=
models
.
CharField
(
max_length
=
200
)
blurb
=
models
.
CharField
(
max_length
=
2000
)
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
title
)
# Create your models here.
# Create your models here.
migs_atienza_reading/db.sqlite3
View file @
367e8a1c
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