Merge branch 'master' into advanced-formset-search
This commit is contained in:
commit
35255cf4e9
@ -50,8 +50,9 @@ class PartsComponentViewSet(viewsets.ModelViewSet):
|
|||||||
queryset = parts_models.Component.objects.all()
|
queryset = parts_models.Component.objects.all()
|
||||||
serializer_class = ComponentSerializer
|
serializer_class = ComponentSerializer
|
||||||
permission_classes = [permissions.DjangoModelPermissions]
|
permission_classes = [permissions.DjangoModelPermissions]
|
||||||
filter_backends = [filters.SearchFilter]
|
filter_backends = [filters.SearchFilter, django_filters.rest_framework.DjangoFilterBackend]
|
||||||
search_fields = ['id', 'name', 'package__name', 'manufacturer__name']
|
search_fields = ['id', 'name', 'package__name', 'manufacturer__name']
|
||||||
|
filterset_fields = ['id', 'name']
|
||||||
|
|
||||||
class PartsComponentTypeViewSet(viewsets.ModelViewSet):
|
class PartsComponentTypeViewSet(viewsets.ModelViewSet):
|
||||||
queryset = parts_models.ComponentType.objects.all()
|
queryset = parts_models.ComponentType.objects.all()
|
||||||
|
Loading…
Reference in New Issue
Block a user