Commit c6ed110b authored by Luis García's avatar Luis García
Browse files

Add filter to new apis

parent de0a9f0e
......@@ -73,7 +73,7 @@ class StateViewSet(DestroyToInvisibleMixin, ModelViewSet):
serializer_class = StateSerializer
permission_classes = (IsStaffOrReadOnly,)
filter_backends = (DjangoFilterBackend,)
filterset_fields = ('name', 'country')
filterset_fields = ('name', 'country', 'country__name')
############################################################
#Rest api for City
......@@ -84,7 +84,7 @@ class CityViewSet(DestroyToInvisibleMixin, ModelViewSet):
serializer_class = CitySerializer
permission_classes = (IsStaffOrReadOnly,)
filter_backends = (DjangoFilterBackend,)
filterset_fields = ('name', 'state')
filterset_fields = ('name', 'state', 'state__name')
############################################################
#Rest api for Suburb
......@@ -95,4 +95,4 @@ class SuburbViewSet(DestroyToInvisibleMixin, ModelViewSet):
serializer_class = SuburbSerializer
permission_classes = (IsStaffOrReadOnly,)
filter_backends = (DjangoFilterBackend,)
filterset_fields = ('name', 'city')
\ No newline at end of file
filterset_fields = ('name', 'city', 'city__name')
\ No newline at end of file
Markdown is supported
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