Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rachpurisima_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
Rachel
rachpurisima_reading
Commits
5d7303e0
Commit
5d7303e0
authored
Mar 30, 2023
by
rachbit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed missing functions in bookshelf/models
parent
5e90bd32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
models.py
rachpurisima_reading/bookshelf/models.py
+7
-0
authors.html
...risima_reading/bookshelf/templates/bookshelf/authors.html
+1
-1
No files found.
rachpurisima_reading/bookshelf/models.py
View file @
5d7303e0
...
@@ -12,6 +12,10 @@ class Author(models.Model):
...
@@ -12,6 +12,10 @@ class Author(models.Model):
def
__str__
(
self
):
def
__str__
(
self
):
return
'{} {}'
.
format
(
self
.
first_name
,
self
.
last_name
)
return
'{} {}'
.
format
(
self
.
first_name
,
self
.
last_name
)
def
get_absolute_url
(
self
):
return
reverse
(
"bookshelf:author_details"
,
kwargs
=
{
'pk'
:
self
.
pk
})
class
Book
(
models
.
Model
):
class
Book
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
100
)
title
=
models
.
CharField
(
max_length
=
100
)
...
@@ -23,3 +27,6 @@ class Book(models.Model):
...
@@ -23,3 +27,6 @@ class Book(models.Model):
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
title
)
return
'{}'
.
format
(
self
.
title
)
def
get_absolute_url
(
self
):
return
reverse
(
"bookshelf:book_details"
,
kwargs
=
{
'pk'
:
self
.
pk
})
rachpurisima_reading/bookshelf/templates/bookshelf/authors.html
View file @
5d7303e0
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
{% for object in object_list %}
{% for object in object_list %}
<li>
<li>
<a
href=
"{{ object.get_absolute_url }}"
>
<a
href=
"{{ object.get_absolute_url }}"
>
{{
object.first_name }}{{ object.last_name
}}
{{
object.first_name}} {{object.last_name
}}
</a>
</a>
</li>
</li>
{% endfor %}
{% endfor %}
...
...
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