[PATCH v2 04/13] REST: Make use of the 'source' property

Andy Doan andy.doan at linaro.org
Wed Nov 23 04:53:43 AEDT 2016


On 11/19/2016 10:51 AM, Stephen Finucane wrote:
> This is apparently the correct way to rename fields, and will ensure a
> future API version that supports writes will work correctly.
>
> Signed-off-by: Stephen Finucane <stephen at that.guru>
> Cc: Andy Doan <andy.doan at linaro.org>

Much better:

Reviewed-by: Andy Doan <andy.doan at linaro.org>

>  patchwork/api/project.py | 15 +++++++--------

> +    # TODO(stephenfin): These should be renamed at the model layer

Doesn't seem worth it to me.

> +    link_name = CharField(max_length=255, source='linkname')
> +    list_id = CharField(max_length=255, source='listid')
> +    list_email = CharField(max_length=255, source='listemail')



More information about the Patchwork mailing list