Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
stefan_gomez_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
Stefan Gomez
stefan_gomez_reading
Commits
e4afc3ca
Commit
e4afc3ca
authored
Mar 27, 2023
by
Stefan Gomez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filled the models and the admin files of the project accordingly.
parent
3bed98bf
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
52 additions
and
0 deletions
+52
-0
__init__.py
stefan_gomez_reading/bookshelf/__init__.py
+0
-0
admin.py
stefan_gomez_reading/bookshelf/admin.py
+14
-0
apps.py
stefan_gomez_reading/bookshelf/apps.py
+6
-0
__init__.py
stefan_gomez_reading/bookshelf/migrations/__init__.py
+0
-0
models.py
stefan_gomez_reading/bookshelf/models.py
+26
-0
tests.py
stefan_gomez_reading/bookshelf/tests.py
+3
-0
views.py
stefan_gomez_reading/bookshelf/views.py
+3
-0
db.sqlite3
stefan_gomez_reading/db.sqlite3
+0
-0
__init__.cpython-311.pyc
...stefan_gomez_reading/__pycache__/__init__.cpython-311.pyc
+0
-0
settings.cpython-311.pyc
...stefan_gomez_reading/__pycache__/settings.cpython-311.pyc
+0
-0
urls.cpython-311.pyc
...ing/stefan_gomez_reading/__pycache__/urls.cpython-311.pyc
+0
-0
No files found.
stefan_gomez_reading/bookshelf/__init__.py
0 → 100644
View file @
e4afc3ca
stefan_gomez_reading/bookshelf/admin.py
0 → 100644
View file @
e4afc3ca
from
django.contrib
import
admin
from
.
models
import
Author
,
Books
class
AuthortAdmin
(
admin
.
ModelAdmin
):
model
=
Author
class
BooksAdmin
(
admin
.
ModelAdmin
):
model
=
Books
admin
.
site
.
register
(
Author
,
AuthorAdmin
)
admin
.
site
.
register
(
Books
,
BooksAdmin
)
stefan_gomez_reading/bookshelf/apps.py
0 → 100644
View file @
e4afc3ca
from
django.apps
import
AppConfig
class
BookshelfConfig
(
AppConfig
):
default_auto_field
=
'django.db.models.BigAutoField'
name
=
'bookshelf'
stefan_gomez_reading/bookshelf/migrations/__init__.py
0 → 100644
View file @
e4afc3ca
stefan_gomez_reading/bookshelf/models.py
0 → 100644
View file @
e4afc3ca
from
django.db
import
models
class
Author
(
models
.
Model
):
first_name
=
models
.
CharField
(
max_length
=
100
)
last_name
=
models
.
CharField
(
max_length
=
100
)
age
=
models
.
IntegerField
()
nationality
=
models
.
CharField
(
max_length
=
20
)
bio
=
models
.
TextField
(
max_length
=
700
)
def
__str__
(
self
):
return
'{}, {}'
.
format
(
self
.
last_name
,
self
.
first_name
)
class
Books
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
100
)
author
=
models
.
ForeignKey
(
Author
,
on_delete
=
models
.
CASCADE
)
publisher
=
models
.
CharField
(
max_length
=
100
)
year_published
=
models
.
IntegerField
()
ISBN
=
models
.
IntegerField
()
blurb
=
models
.
TextField
(
max_length
=
200
)
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
title
)
\ No newline at end of file
stefan_gomez_reading/bookshelf/tests.py
0 → 100644
View file @
e4afc3ca
from
django.test
import
TestCase
# Create your tests here.
stefan_gomez_reading/bookshelf/views.py
0 → 100644
View file @
e4afc3ca
from
django.shortcuts
import
render
# Create your views here.
stefan_gomez_reading/db.sqlite3
0 → 100644
View file @
e4afc3ca
stefan_gomez_reading/stefan_gomez_reading/__pycache__/__init__.cpython-311.pyc
0 → 100644
View file @
e4afc3ca
File added
stefan_gomez_reading/stefan_gomez_reading/__pycache__/settings.cpython-311.pyc
0 → 100644
View file @
e4afc3ca
File added
stefan_gomez_reading/stefan_gomez_reading/__pycache__/urls.cpython-311.pyc
0 → 100644
View file @
e4afc3ca
File added
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