Skip to content

Commit

Permalink
Merge pull request #173 from rdmorganiser/api
Browse files Browse the repository at this point in the history
Add API filter options
  • Loading branch information
triole committed Jan 21, 2020
2 parents 778cd89 + a8ce00c commit 9f78501
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
6 changes: 4 additions & 2 deletions rdmo/options/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ class OptionSetViewSet(ModelViewSet):
filter_backends = (DjangoFilterBackend,)
filterset_fields = (
'uri',
'key'
'key',
'comment'
)

@action(detail=False)
Expand All @@ -41,7 +42,8 @@ class OptionViewSet(ModelViewSet):
filterset_fields = (
'uri',
'key',
'optionset'
'optionset',
'comment'
)

@action(detail=False)
Expand Down
16 changes: 12 additions & 4 deletions rdmo/questions/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class CatalogViewSet(ModelViewSet):
filter_backends = (DjangoFilterBackend,)
filterset_fields = (
'uri',
'key'
'key',
'comment'
)

@action(detail=True)
Expand All @@ -51,7 +52,8 @@ class SectionViewSet(ModelViewSet):
'uri',
'path',
'key',
'catalog'
'catalog',
'comment'
)

@action(detail=True)
Expand All @@ -73,10 +75,13 @@ class QuestionSetViewSet(ModelViewSet):

filter_backends = (DjangoFilterBackend,)
filterset_fields = (
'attribute',
'uri',
'path',
'key',
'section'
'section',
'comment',
'is_collection'
)

@action(detail=True)
Expand All @@ -98,13 +103,16 @@ class QuestionViewSet(ModelViewSet):

filter_backends = (DjangoFilterBackend,)
filterset_fields = (
'attribute',
'uri',
'path',
'key',
'questionset',
'is_collection',
'value_type',
'widget_type'
'widget_type',
'unit',
'comment'
)

@action(detail=True)
Expand Down
3 changes: 2 additions & 1 deletion rdmo/tasks/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class TaskViewSet(ModelViewSet):
filter_backends = (DjangoFilterBackend,)
filterset_fields = (
'uri',
'key'
'key',
'comment'
)

@action(detail=False)
Expand Down
3 changes: 2 additions & 1 deletion rdmo/views/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class ViewViewSet(ModelViewSet):
filter_backends = (DjangoFilterBackend,)
filterset_fields = (
'uri',
'key'
'key',
'comment'
)

@action(detail=False)
Expand Down

0 comments on commit 9f78501

Please sign in to comment.