What exception is it throwing? On Wednesday, July 1, 2020 at 2:49:46 PM UTC-5, Gagan Deep wrote: > > I have a SerializerMethodField in serializer. I am catching an exception > in the function like below. I want to skip this object in the ListView > entirely if that exception is caught. How can I do this? > > I am using ListApiView from rest_framework.generics > > > classFooSerializer(serializers.ModelSerializer): > foo = serializers.SerializerMethodField() > > get_foo(self, object): > try: > # Do something here > except: > # If an exception is captured than skip this object > > >
-- You received this message because you are subscribed to the Google Groups "Django REST framework" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-rest-framework/c15a63b8-b052-4ade-ae0f-c53e57d4a848o%40googlegroups.com.