I don't the exact use case here, but you can pass context while passing data to specializer.And then use it inside creializer clas by self.context.
In this case you can pass query params to context
I have to filter my queryset based on a query param. I have to filter based on serializermethodfield.
Any help would be appreciated.
Thank you --
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0a62f492-3a41-4692-9140-48dd23d7bdbbn%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOecAny7o-MrFSgaNR%2B2tKqshbxUMFtShxHw%3DiCk%2Betp-o8dZw%40mail.gmail.com.
No comments:
Post a Comment