Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
PPTI-Mobile Apps Monitoring Wabah Tuberkolosis
Neza-Backend
Commits
a83d3347
Commit
a83d3347
authored
Apr 17, 2020
by
Dave Nathanael
Browse files
[REFACTOR] Make separate field constant for CaseSubject ordering filter
parent
53b06d5f
Pipeline
#40889
failed with stages
in 1 minute and 26 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/cases/filters.py
View file @
a83d3347
...
...
@@ -9,7 +9,6 @@ CASE_SUBJECT_FILTERSET_FIELDS = [
"address"
,
"district"
,
"sub_district"
,
"created_at"
,
]
CASE_SUBJECT_SEARCH_FIELDS
=
[
...
...
@@ -21,6 +20,15 @@ CASE_SUBJECT_SEARCH_FIELDS = [
"created_at"
,
]
CASE_SUBJECT_ORDERING_FIELDS
=
[
"name"
,
"age"
,
"is_male"
,
"address"
,
"district"
,
"sub_district"
,
"created_at"
,
]
class
InvestigationCaseFilter
(
FilterSet
):
class
Meta
:
...
...
apps/cases/views.py
View file @
a83d3347
...
...
@@ -26,6 +26,7 @@ from apps.cases.serializers import (
from
apps.cases.filters
import
(
CASE_SUBJECT_FILTERSET_FIELDS
,
CASE_SUBJECT_SEARCH_FIELDS
,
CASE_SUBJECT_ORDERING_FIELDS
,
InvestigationCaseFilter
,
MonitoringCaseFilter
,
)
...
...
@@ -49,7 +50,7 @@ class CaseSubjectViewSet(viewsets.ModelViewSet):
permission_classes
=
(
IsAuthorOrAdministrator
,)
pagination_class
=
PageNumberPagination
search_fields
=
CASE_SUBJECT_SEARCH_FIELDS
ordering_fields
=
CASE_SUBJECT_
FILTERSET
_FIELDS
ordering_fields
=
CASE_SUBJECT_
ORDERING
_FIELDS
class
InvestigationCaseViewSet
(
viewsets
.
ViewSet
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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