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
1a5f445c
Commit
1a5f445c
authored
Jul 16, 2024
by
Ilham Maulana
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: book loans order list
parent
80972dba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
views.py
loans/views.py
+4
-4
No files found.
loans/views.py
View file @
1a5f445c
...
@@ -17,15 +17,15 @@ class BookLoanListView(generic.ListView):
...
@@ -17,15 +17,15 @@ class BookLoanListView(generic.ListView):
if
keyword
:
if
keyword
:
queryset
=
queryset
.
filter
(
queryset
=
queryset
.
filter
(
Q
(
book__title__icontains
=
keyword
)
|
Q
(
member__name__icontains
=
keyword
)
Q
(
book__title__icontains
=
keyword
)
|
Q
(
member__name__icontains
=
keyword
)
)
.
order_by
(
"-
loan_date
"
)
)
.
order_by
(
"-
created_at
"
)
if
order
:
if
order
:
if
order
==
"new"
:
if
order
==
"new"
:
queryset
=
queryset
.
order_by
(
"-
loan_date
"
)
queryset
=
queryset
.
order_by
(
"-
created_at
"
)
elif
order
==
"old"
:
elif
order
==
"old"
:
queryset
=
queryset
.
order_by
(
"
loan_date
"
)
queryset
=
queryset
.
order_by
(
"
created_at
"
)
return
queryset
.
order_by
(
"-
loan_date
"
)
return
queryset
.
order_by
(
"-
created_at
"
)
class
BookLoanCreateView
(
generic
.
edit
.
CreateView
):
class
BookLoanCreateView
(
generic
.
edit
.
CreateView
):
...
...
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