When using the browsable API and looking at the data for a detail view, a 
PUT form is shown at the bottom of the page. It was my understand that the 
fields in this form ought to be pre-populated with the current values of 
the object that I'm viewing (and would be updating). Even with the most 
simple example, this has never been the case for me, the form is always 
blank (or filled with defaults).

>From looking at the code for the BrowsableAPIRender, it appears that it 
will pre-populate the form if it can get the current instance from the 
serializer. However, it doesn't appear that the renderer has access to the 
serializer. On line 454 
<https://github.com/encode/django-rest-framework/blob/19915d19170c48961cc4cb97d773c99cba11aff1/rest_framework/renderers.py#L454>
 it 
attempts to get the serializer as an attribute of the rendered data, but 
I'm not sure in what circumstance the data (usually serializer.data which 
ends up being an OrderedDict) would have a .serializer attribute.

Is this just something that's broken that I should submit as an issue, or 
is there some step I'm missing to get the PUT form to show the current data?

-- 
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/e5653f38-6642-47ab-99f6-0bc56162a4bbn%40googlegroups.com.

Reply via email to