[PATCH v2 3/6] models: Add 'mbox_url' permalink for bundles

Andy Doan andy.doan at linaro.org
Wed Mar 15 02:44:37 AEDT 2017


On 03/07/2017 01:22 PM, Stephen Finucane wrote:
> We're going to use this for downloading mboxes via the REST API.
>
> Signed-off-by: Stephen Finucane <stephen at that.guru>
> Cc: Daniel Axtens <dja at axtens.net>

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

> ---
>  patchwork/models.py | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/patchwork/models.py b/patchwork/models.py
> index cfe5b51..43da251 100644
> --- a/patchwork/models.py
> +++ b/patchwork/models.py
> @@ -746,6 +746,11 @@ class Bundle(models.Model):
>              'bundlename': self.name,
>          })
>
> +    @models.permalink
> +    def get_mbox_url(self):
> +        return ('bundle-mbox', (), {'bundlename': self.name,
> +                                    'username': self.owner.username})
> +
>      class Meta:
>          unique_together = [('owner', 'name')]
>
>



More information about the Patchwork mailing list