Incorrect "Raw data" in Browsable API

39 views
Skip to first unread message

Nacharov Mikhail

unread,
Dec 28, 2015, 11:21:03 PM12/28/15
to Django REST framework
Hello guys!

Does somebody know why read_only fields comes in sample update request in "Raw data" tab in Browsable API?

Xavier Ordoquy

unread,
Dec 29, 2015, 9:17:40 AM12/29/15
to Django REST framework
Hi,


Le mardi 29 décembre 2015 05:21:03 UTC+1, Nacharov Mikhail a écrit :
Hello guys!

Does somebody know why read_only fields comes in sample update request in "Raw data" tab in Browsable API?

This is probably because it gets the data from the object serialization.
This is a non issue as the read only data will get discarded during the validation.

Regards,
Xavier.

Начаров Михаил

unread,
Dec 29, 2015, 11:34:05 PM12/29/15
to django-res...@googlegroups.com
Well, it is issue for my project because I don't want misinform clients about required fields in the request..
To work around this I redefined method get_serializer_class to return another serializer when PUT request processing. But I don't think that it is a best way to do that..


--
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/RbxtWZh46OM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best regards!
Nacharov Mikhail
Reply all
Reply to author
Forward
0 new messages