Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' into cms-notification-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mparent61 committed Jul 27, 2016
2 parents f203d50 + 100eea8 commit b654195
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
## Version 3.8.1

- Added `ImageFieldSerializer` for `Notification.image`
- Added `Notification` endpoint sorting support

## Version 3.8.0

Expand Down
7 changes: 6 additions & 1 deletion bulbs/notifications/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ class NotificationViewSet(viewsets.ModelViewSet):

queryset = Notification.objects.all().order_by('-created_on')
serializer_class = NotificationSerializer
filter_backends = (filters.DjangoFilterBackend, filters.SearchFilter)
filter_backends = (filters.DjangoFilterBackend,
filters.OrderingFilter,
filters.SearchFilter)
filter_fields = ('is_published',)
search_fields = ('internal_title',)
ordering_fields = ('internal_title',
'is_published',
'created_on')
paginate_by = 20
permission_classes = [IsAdminUser]

Expand Down

0 comments on commit b654195

Please sign in to comment.