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
a555a7a2
Commit
a555a7a2
authored
Jul 15, 2024
by
Ilham Maulana
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: search field
parent
b702d4bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
views.py
api/loans/views.py
+7
-0
No files found.
api/loans/views.py
View file @
a555a7a2
...
...
@@ -12,6 +12,13 @@ class BookLoanViewSet(viewsets.ModelViewSet):
serializer_class
=
BookLoanSerializer
filter_backends
=
[
DjangoFilterBackend
,
SearchFilter
]
filterset_fields
=
[
"loan_date"
,
"due_date"
,
"return_date"
]
search_fields
=
[
"member__user__username"
,
"member__user__email"
,
"member__user__first_name"
,
"member__user__last_name"
,
"book__title"
,
]
def
update
(
self
,
request
,
pk
):
instance
=
self
.
get_object
()
...
...
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