News for hackers. Stuff that matters.
Re:Django REST framework 3.5 by Kpourdeilami on Thursday October 20, 2016 @07:48PM (#12757151)
I think it's better to define field specific read/write permissions through the serializers. In the serializer's Meta class, you can define a readonly_fields tuple containing the string names of the read only fields
Re:Django REST framework 3.5 by qnrq on Thursday October 20, 2016 @11:32PM (#12757984)
You can also route only read-only methods in urls.py, for example via:

    url(
        r'path/$',
        TheModelViewSetView.as_view({"get": "list"}),
        name="thename"
    )
or "retrieve" instead of "list" for a route which includes PK.

This of course makes the entire path read-only so it's not a way to make some fields writable and others not.

Re:Django REST framework 3.5 by rtpg on Friday October 21, 2016 @02:36AM (#12758564)
yeah, I think they're saying instead of having the Meta fields list create writable fields by default, it should be read-only by default, after which you could add a "writable_fields" list