From: Stephen Finucane Date: Tue, 21 Feb 2017 19:34:56 +0000 (-0500) Subject: models: Add 'mbox_url' permalink for bundles X-Git-Tag: v2.0.0-rc1~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b90b0312a94ae83d325494b57f864f8d9f66fff7;p=thirdparty%2Fpatchwork.git models: Add 'mbox_url' permalink for bundles We're going to use this for downloading mboxes via the REST API. Signed-off-by: Stephen Finucane Reviewed-by: Andy Doan --- diff --git a/patchwork/models.py b/patchwork/models.py index 94aaa0f5..199c1182 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -741,6 +741,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')]