I'm using EC2 instance and ngrok for hosting my site(just for checking). but it is not working for me. Whenever I write ?expand=order_lines, it is not giving me the desired output.
But when I implement it in my system, it is working very well. Can someone please check.
class OrderAPIView(SerializerExtensionsAPIViewMixin, ListCreateAPIView):
pagination_class = OrderPagination
serializer_class = OrderSerializer
#authentication_classes = (OrderAuthentication, )
def get_queryset(self):
type = self.request.GET.get('type', None)
advertiser_id = self.request.GET.get('advertiser_id', None)
status = self.request.GET.get('status', None)
qs = Order.objects.all()
if type is not None:
qs = qs.filter(type__icontains=type)
if advertiser_id is not None:
qs = qs.filter(advertiser_id__icontains=advertiser_id)
if status is not None:
qs = qs.filter(status__icontains=status)
return qs**
Note: It's working on my local machine but not when I host it using ngrok for my EC2 instance. I've installed the package and added the app in Installed_Apps
Apologies from my side as I did a silly mistake.. It is now resolved and thanks to the contributors of this pkg. It is surely a useful pkg for selective fields
I'm using EC2 instance and ngrok for hosting my site(just for checking). but it is not working for me. Whenever I write ?expand=order_lines, it is not giving me the desired output. But when I implement it in my system, it is working very well. Can someone please check.
serializers.py
**from rest_framework_serializer_extensions.serializers import SerializerExtensionsMixin
class OrderLineSerializer(serializers.ModelSerializer): ad_length = serializers.IntegerField(required=False, allow_null=True) targeting = serializers.JSONField(allow_null=True, required=False)
class OrderSerializer(serializers.ModelSerializer):
view.py
**from rest_framework_serializer_extensions.views import SerializerExtensionsAPIViewMixin
class OrderAPIView(SerializerExtensionsAPIViewMixin, ListCreateAPIView):
Note: It's working on my local machine but not when I host it using ngrok for my EC2 instance. I've installed the package and added the app in Installed_Apps