Commit acceb74e authored by Julien Palard's avatar Julien Palard
Browse files

Renamed in django-filters 2.0.0.

parent 2406e8c5
...@@ -115,7 +115,7 @@ class GroupViewSet(viewsets.ModelViewSet): ...@@ -115,7 +115,7 @@ class GroupViewSet(viewsets.ModelViewSet):
class AnswerViewSet(viewsets.ModelViewSet): class AnswerViewSet(viewsets.ModelViewSet):
permission_classes = [AnswerPermission] permission_classes = [AnswerPermission]
queryset = Answer.objects.all() queryset = Answer.objects.all()
filter_fields = ("is_corrected", "is_valid") filterset_fields = ("is_corrected", "is_valid", "user")
def get_queryset(self): def get_queryset(self):
if self.request.user.is_staff: if self.request.user.is_staff:
...@@ -134,7 +134,7 @@ class AnswerViewSet(viewsets.ModelViewSet): ...@@ -134,7 +134,7 @@ class AnswerViewSet(viewsets.ModelViewSet):
class SnippetViewSet(viewsets.ModelViewSet): class SnippetViewSet(viewsets.ModelViewSet):
permission_classes = [AnswerPermission] # Snippets are like answers: Create only. permission_classes = [AnswerPermission] # Snippets are like answers: Create only.
queryset = Snippet.objects.all() queryset = Snippet.objects.all()
filter_fields = ("executed_at",) filterset_fields = ("executed_at",)
def get_queryset(self): def get_queryset(self):
if self.request.user.is_staff: if self.request.user.is_staff:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment