Skip to content

Commit

Permalink
Allow sorting sources by updated date
Browse files Browse the repository at this point in the history
  • Loading branch information
CFarcy committed Dec 15, 2023
1 parent 3c666a5 commit f2dd036
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/source/others/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Changelog

**Improvements:**

- Api result for are now filterable by model type and status
- Api result for sources are now filterable by model type and status
- Api result for sources Sources are now sortable by updated date


2023.11.2 (2023-11-22)
Expand Down
2 changes: 2 additions & 0 deletions project/geosource/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ class Meta:
"name",
"geom_type",
"report",
"updated_at",
)
extras = {"read_only": {"updated_at": True}}

def get__type(self, instance):
return instance.__class__.__name__
Expand Down
1 change: 1 addition & 0 deletions project/geosource/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SourceModelViewset(ModelViewSet):
"geom_type",
"id",
"slug",
"updated_at",
)
filterset_class = SourceFilterSet
search_fields = ["name"]
Expand Down

0 comments on commit f2dd036

Please sign in to comment.