Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jaysonlim_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
Jayson Lim
jaysonlim_reading
Commits
93252b9b
Commit
93252b9b
authored
Mar 28, 2023
by
Jayson Lim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented Admin panel
parent
ea2f399c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
1 deletion
+33
-1
admin.cpython-39.pyc
jaysonlim_reading/bookshelf/__pycache__/admin.cpython-39.pyc
+0
-0
models.cpython-39.pyc
...onlim_reading/bookshelf/__pycache__/models.cpython-39.pyc
+0
-0
admin.py
jaysonlim_reading/bookshelf/admin.py
+10
-1
0002_rename_books_book.py
...im_reading/bookshelf/migrations/0002_rename_books_book.py
+17
-0
0002_rename_books_book.cpython-39.pyc
...rations/__pycache__/0002_rename_books_book.cpython-39.pyc
+0
-0
models.py
jaysonlim_reading/bookshelf/models.py
+6
-0
db.sqlite3
jaysonlim_reading/db.sqlite3
+0
-0
No files found.
jaysonlim_reading/bookshelf/__pycache__/admin.cpython-39.pyc
View file @
93252b9b
No preview for this file type
jaysonlim_reading/bookshelf/__pycache__/models.cpython-39.pyc
View file @
93252b9b
No preview for this file type
jaysonlim_reading/bookshelf/admin.py
View file @
93252b9b
from
django.contrib
import
admin
from
.models
import
Author
,
Books
# Register your models here.
class
AuthorAdmin
(
admin
.
ModelAdmin
):
model
=
Author
class
BooksAdmin
(
admin
.
ModelAdmin
):
model
=
Books
admin
.
site
.
register
(
Author
,
AuthorAdmin
)
admin
.
site
.
register
(
Books
,
BooksAdmin
)
jaysonlim_reading/bookshelf/migrations/0002_rename_books_book.py
0 → 100644
View file @
93252b9b
# Generated by Django 3.2 on 2023-03-28 08:00
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bookshelf'
,
'0001_initial'
),
]
operations
=
[
migrations
.
RenameModel
(
old_name
=
'Books'
,
new_name
=
'Book'
,
),
]
jaysonlim_reading/bookshelf/migrations/__pycache__/0002_rename_books_book.cpython-39.pyc
0 → 100644
View file @
93252b9b
File added
jaysonlim_reading/bookshelf/models.py
View file @
93252b9b
...
...
@@ -7,6 +7,9 @@ class Author(models.Model):
nationality
=
models
.
CharField
(
max_length
=
50
,
default
=
""
)
bio
=
models
.
TextField
(
max_length
=
700
)
def
__str__
(
self
):
return
'{}, {}'
.
format
(
self
.
first_name
,
self
.
last_name
)
class
Books
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
50
,
default
=
""
)
author
=
models
.
ForeignKey
(
Author
,
on_delete
=
models
.
CASCADE
,
related_name
=
'books'
)
...
...
@@ -15,3 +18,6 @@ class Books(models.Model):
ISBN
=
models
.
CharField
(
max_length
=
13
)
blurb
=
models
.
TextField
()
def
__str__
(
self
):
return
self
.
title
jaysonlim_reading/db.sqlite3
View file @
93252b9b
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