On 16 Jun 16:13, Andy Doan wrote:
> This exports patch checks via the REST API.
> 
> The drf-nested-routers package is used to handle the fact Checks are
> nested under a Patch.
> 
> Security Constraints:
>  * Anyone (logged in or not) can read all objects.
>  * No one can update/delete objects.
>  * Project maintainers and patch owners may create objects.
> 
> Signed-off-by: Andy Doan <[email protected]>

I made some changes to this to make the 'date' field read-only (think
there was some miscommunication here). After this:

Reviewed-by: Stephen Finucane <[email protected]>

> +class ChecksSerializer(ModelSerializer):
> +    class Meta:
> +        model = Check

I added:

    read_only_fields = ('date', )

> +    user = HyperlinkedRelatedField(
> +        'user-detail', read_only=True, default=CurrentUserDefault())
> +    patch = HiddenField(default=CurrentPatchDefault())
> +    date = DateTimeField(required=True)

...and I removed this ^^^.
_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork

Reply via email to