Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eurysee_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
Eury See
eurysee_reading
Commits
217eaf80
Commit
217eaf80
authored
Mar 27, 2023
by
Eury See
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created the bookshelf app and built the respective models for the app.
parent
ef3caca2
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
97 additions
and
2 deletions
+97
-2
.DS_Store
eurysee_reading/.DS_Store
+0
-0
.DS_Store
eurysee_reading/bookshelf/.DS_Store
+0
-0
__init__.py
eurysee_reading/bookshelf/__init__.py
+0
-0
admin.py
eurysee_reading/bookshelf/admin.py
+11
-0
apps.py
eurysee_reading/bookshelf/apps.py
+6
-0
0001_initial.py
eurysee_reading/bookshelf/migrations/0001_initial.py
+38
-0
__init__.py
eurysee_reading/bookshelf/migrations/__init__.py
+0
-0
models.py
eurysee_reading/bookshelf/models.py
+22
-0
tests.py
eurysee_reading/bookshelf/tests.py
+3
-0
urls.py
eurysee_reading/bookshelf/urls.py
+9
-0
views.py
eurysee_reading/bookshelf/views.py
+4
-0
db.sqlite3
eurysee_reading/db.sqlite3
+0
-0
settings.py
eurysee_reading/eurysee_reading/settings.py
+1
-0
urls.py
eurysee_reading/eurysee_reading/urls.py
+3
-2
No files found.
eurysee_reading/.DS_Store
View file @
217eaf80
No preview for this file type
eurysee_reading/bookshelf/.DS_Store
0 → 100644
View file @
217eaf80
File added
eurysee_reading/bookshelf/__init__.py
0 → 100644
View file @
217eaf80
eurysee_reading/bookshelf/admin.py
0 → 100644
View file @
217eaf80
from
django.contrib
import
admin
from
.models
import
Author
,
Books
class
AuthorAdmin
(
admin
.
ModelAdmin
):
model
=
Author
class
BooksAdmin
(
admin
.
ModelAdmin
):
model
=
Books
admin
.
site
.
register
(
Author
,
AuthorAdmin
)
admin
.
site
.
register
(
Books
,
BooksAdmin
)
\ No newline at end of file
eurysee_reading/bookshelf/apps.py
0 → 100644
View file @
217eaf80
from
django.apps
import
AppConfig
class
BookshelfConfig
(
AppConfig
):
default_auto_field
=
'django.db.models.BigAutoField'
name
=
'bookshelf'
eurysee_reading/bookshelf/migrations/0001_initial.py
0 → 100644
View file @
217eaf80
# Generated by Django 4.1.7 on 2023-03-27 13:57
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Author'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'first_name'
,
models
.
CharField
(
max_length
=
50
)),
(
'last_name'
,
models
.
CharField
(
max_length
=
50
)),
(
'age'
,
models
.
IntegerField
()),
(
'nationality'
,
models
.
CharField
(
max_length
=
50
)),
(
'bio'
,
models
.
TextField
(
max_length
=
700
)),
],
),
migrations
.
CreateModel
(
name
=
'Books'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'title'
,
models
.
CharField
(
max_length
=
100
)),
(
'publisher'
,
models
.
CharField
(
max_length
=
100
)),
(
'year_published'
,
models
.
IntegerField
()),
(
'ISBN'
,
models
.
IntegerField
()),
(
'blurb'
,
models
.
CharField
(
max_length
=
200
)),
(
'author'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'bookshelf.author'
)),
],
),
]
eurysee_reading/bookshelf/migrations/__init__.py
0 → 100644
View file @
217eaf80
eurysee_reading/bookshelf/models.py
0 → 100644
View file @
217eaf80
from
django.db
import
models
class
Author
(
models
.
Model
):
first_name
=
models
.
CharField
(
max_length
=
50
)
last_name
=
models
.
CharField
(
max_length
=
50
)
age
=
models
.
IntegerField
()
nationality
=
models
.
CharField
(
max_length
=
50
)
bio
=
models
.
TextField
(
max_length
=
700
)
def
__str__
(
self
):
return
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
.
CharField
(
max_length
=
200
)
def
__str__
(
self
):
return
self
.
title
\ No newline at end of file
eurysee_reading/bookshelf/tests.py
0 → 100644
View file @
217eaf80
from
django.test
import
TestCase
# Create your tests here.
eurysee_reading/bookshelf/urls.py
0 → 100644
View file @
217eaf80
from
django.urls
import
path
from
.views
import
index
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
]
# This might be needed, depending on your Django version
app_name
=
"bookshelf"
\ No newline at end of file
eurysee_reading/bookshelf/views.py
0 → 100644
View file @
217eaf80
from
django.shortcuts
import
render
def
index
(
request
):
return
HttpResponse
(
""
)
eurysee_reading/db.sqlite3
0 → 100644
View file @
217eaf80
File added
eurysee_reading/eurysee_reading/settings.py
View file @
217eaf80
...
@@ -37,6 +37,7 @@ INSTALLED_APPS = [
...
@@ -37,6 +37,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'bookshelf'
,
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
...
eurysee_reading/eurysee_reading/urls.py
View file @
217eaf80
...
@@ -14,8 +14,9 @@ Including another URLconf
...
@@ -14,8 +14,9 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
"""
from
django.contrib
import
admin
from
django.contrib
import
admin
from
django.urls
import
path
from
django.urls
import
include
,
path
urlpatterns
=
[
urlpatterns
=
[
path
(
'bookshelf/'
,
include
(
'bookshelf.urls'
,
namespace
=
"bookshelf"
)),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'admin/'
,
admin
.
site
.
urls
),
]
]
\ 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