[RFC 06/11] REST: Add Patches to the API

Andy Doan andy.doan at linaro.org
Wed May 11 08:30:51 AEST 2016


On 05/09/2016 08:45 AM, Finucane, Stephen wrote:
>> -def create_model_serializer(model_class):
>> >+def create_model_serializer(model_class, read_only=None):
>> >      class PatchworkSerializer(ModelSerializer):
>> >          class Meta:
>> >              model = model_class
>> >+            read_only_fields = read_only
> Ah, here we go. I suspect excluded fields will come up soon.

Yep - I was just trying to introduce functionality as it was needed. 
Most models are fine exporting everything.

> In any
> case, surely DRF has this kind of factory functionality built in?

There isn't really, but as I said, after removing a couple of endpoints 
and other simplifications, this generator isn't really that useful and 
will be removed in v2.


More information about the Patchwork mailing list