Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Some specialized serializers needs the request in context. #119

Merged
merged 2 commits into from
May 18, 2015

Conversation

ticosax
Copy link
Contributor

@ticosax ticosax commented May 13, 2015

No description provided.

@jpadilla
Copy link
Owner

@ticosax what if instead we did something like what GenericAPIView does providing get_serializer(), get_serializer_class(), and get_serializer_context()?

@ticosax
Copy link
Contributor Author

ticosax commented May 15, 2015

Sounds good. I'll work on it from next Monday.
I'll keep you updated.

It allows user to overrides get_serializer_context() or get_serializer_class()
when subclassing the view.
The implementation is taken `from rest_framework/generics.py`
@ticosax
Copy link
Contributor Author

ticosax commented May 18, 2015

@jpadilla
I almost copy pasted the code from GenericAPIView. and provided request and view entries in context. May be you prefer I keep it empty like it is today ?

@jpadilla
Copy link
Owner

@ticosax that's fine by me, thanks!

jpadilla added a commit that referenced this pull request May 18, 2015
Some specialized serializers needs the request in context.
@jpadilla jpadilla merged commit f3a22c9 into jpadilla:master May 18, 2015
@ticosax ticosax deleted the request-on-context branch May 20, 2015 12:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants