My opinion is that read_only_fields feature is already provided by extra_kwargs which does much more than just set the read/write flag. That would also help provide this feature which is under used by users.
Note that I said "I’m willing to remove it" and did *not* say "it will be removed". Regards, Xavier Ordoquy, Linovia. > Le 17 mars 2017 à 07:43, CocaCola <[email protected]> a écrit : > > Will read_only_fields also disappear? soon? > > > Any reason? > > class SomeSerializer(serializer.ModelSerializer): > class Meta: > model = SomeModel > fields = ('somefield1', 'somefield2', 'somefield3') > extra_kwargs = { > 'somefield2': {'write_only': True}, > 'somefield3': {'read_only': True} > } > > -- > 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] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <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.
