Browsable API doesn't show lookup fields

36 views
Skip to first unread message

Andrey Shipilov

unread,
Nov 10, 2015, 4:52:42 AM11/10/15
to Django REST framework

Hi, I might be doing something wrong, but I cant get the lookup fields to show in the browsable API. I have django-filter and django-crispy-forms installed. Both of them are listed in the INSTALLED_APPS.

That's the viewset:

class EventsViewSet(viewsets.ReadOnlyModelViewSet):
    queryset = Event.get_current()
    serializer_class = EventSerializer
    filter_backends = (filters.DjangoFilterBackend,)
    filter_fields = ('venue',)

That's the serializer:

class EventSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = Event

The browser shows all the objects perfectly fine, but not the filter input for "venue". Am I doing something wrong?

Thanks ahead.

Reply all
Reply to author
Forward
0 new messages