Hi,

Sure, that's the view passed within the serializer's context.

Regards,
Xavier
Linovia

Envoyé de mon iPhone

> Le 3 oct. 2016 à 00:24, 'AJ Ostergaard' via Django REST framework 
> <[email protected]> a écrit :
> 
> Are ViewSet instances available from Serializers?
> 
> 
>> On 2 Oct 2016 20:24, "Kevin Brown" <[email protected]> wrote:
>> ViewSet instances should have a get_serializer_context(self) method which 
>> they inherit from the generic API views. Remember that ViewSet instances are 
>> generic API views using mixins with a little extra added on top for routing 
>> purposes.
>> 
>> 
>>> On Sun, Oct 2, 2016, 13:52 'AJ Ostergaard' via Django REST framework 
>>> <[email protected]> wrote:
>>> Is there a way to add serializer context when using viewsets? I'm referring 
>>> to the functionality discussed here which is difficult to implement in a 
>>> viewset where only the serializer class is defined. Could obviously be done 
>>> by overriding all the methods but that would kinda miss the point of 
>>> viewsets.
>>> -- 
>>> 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 [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django REST framework" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-rest-framework/e0d6Jzkl1_o/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to