Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
library-app-django
Project
Project
Details
Activity
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
Ilham Maulana
library-app-django
Commits
34511b04
Commit
34511b04
authored
Jul 09, 2024
by
impfundev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: search book, filtered by category
parent
a3af8e9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
book_table_data.html
books/templates/book_table_data.html
+2
-0
views.py
books/views.py
+3
-1
No files found.
books/templates/book_table_data.html
View file @
34511b04
...
...
@@ -30,6 +30,7 @@
</tr>
{% endfor %} {% else %}
<tr
class=
"w-100"
>
<td></td>
<td></td>
<td></td>
<td>
...
...
@@ -37,6 +38,7 @@
</td>
<td></td>
<td></td>
<td></td>
</tr>
{% endif %}
</tbody>
...
...
books/views.py
View file @
34511b04
...
...
@@ -16,7 +16,9 @@ class BookListView(generic.ListView):
if
keyword
:
queryset
=
queryset
.
filter
(
Q
(
title__icontains
=
keyword
)
|
Q
(
description__icontains
=
keyword
)
Q
(
title__icontains
=
keyword
)
|
Q
(
category__name__icontains
=
keyword
)
|
Q
(
description__icontains
=
keyword
)
)
.
order_by
(
"-created_at"
)
if
order
:
...
...
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