Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Neptune_Sy_music
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
Star Neptune R. Sy
Neptune_Sy_music
Commits
4dc16d41
Commit
4dc16d41
authored
Apr 25, 2023
by
Star Neptune R. Sy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
front end of add-author is done. Along with the createView of both sites
parent
e3dc6a99
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
8 deletions
+9
-8
forms.py
neptunesy_reading/bookshelf/forms.py
+0
-2
add-book.html
...unesy_reading/bookshelf/templates/bookshelf/add-book.html
+3
-2
home.html
neptunesy_reading/bookshelf/templates/home.html
+1
-1
urls.py
neptunesy_reading/bookshelf/urls.py
+2
-2
views.py
neptunesy_reading/bookshelf/views.py
+3
-1
No files found.
neptunesy_reading/bookshelf/forms.py
View file @
4dc16d41
from
django
import
forms
neptunesy_reading/bookshelf/templates/bookshelf/add-book.html
View file @
4dc16d41
{% extends 'base.html '%}
{% block title %} Add new
b
ook {% endblock %}
{% block title %} Add new
B
ook {% endblock %}
{% block content %}
...
...
@@ -26,4 +26,5 @@
</form>
{% endblock %}
\ No newline at end of file
{% endblock %}
neptunesy_reading/bookshelf/templates/home.html
View file @
4dc16d41
...
...
@@ -11,7 +11,7 @@
<a
class=
"navBtn"
href=
"/authors"
>
Authors
</a>
<br>
<a
class=
"navBtn"
href=
"/books/add"
>
Add Book
</a>
<
!--<a class="navBtn" href="/authors">Add Author</a>--
>
<
a
class=
"navBtn"
href=
"/authors/add"
>
Add Author
</a
>
</div>
{% endblock %}
neptunesy_reading/bookshelf/urls.py
View file @
4dc16d41
# bookshelf/urls.py
from
django.urls
import
path
from
.views
import
(
homeView
,
BooksView
,
BooksAddView
,
BooksDetail
,
AuthorView
,
AuthorDetail
)
from
.views
import
(
homeView
,
BooksView
,
BooksAddView
,
BooksDetail
,
AuthorView
,
Author
AddView
,
Author
Detail
)
from
django.conf.urls.static
import
static
urlpatterns
=
[
...
...
@@ -11,7 +11,7 @@ urlpatterns = [
path
(
'authors/<int:pk>/details/'
,
AuthorDetail
.
as_view
(),
name
=
"author_details"
),
#path for the forms that add
path
(
'books/add'
,
BooksAddView
.
as_view
(),
name
=
'add_books'
),
#path('authors/add
'),
path
(
'authors/add'
,
AuthorAddView
.
as_view
(),
name
=
'add_author
'
),
]
# This might be needed, depending on your Django version
...
...
neptunesy_reading/bookshelf/views.py
View file @
4dc16d41
from
django.shortcuts
import
render
from
django.views.generic.detail
import
DetailView
from
django.views.generic.list
import
ListView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Author
,
Book
def
homeView
(
request
):
...
...
@@ -12,8 +13,9 @@ class BooksView(ListView):
template_name
=
"bookshelf/books.html"
class
BooksAddView
(
List
View
):
class
BooksAddView
(
Create
View
):
model
=
Author
fields
=
'__all__'
template_name
=
"bookshelf/add-book.html"
...
...
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