]> err.no Git - peojumk/commitdiff
Add absolute url property on invoice
authorTollef Fog Heen <tfheen@err.no>
Wed, 1 Aug 2012 18:28:51 +0000 (20:28 +0200)
committerTollef Fog Heen <tfheen@err.no>
Wed, 1 Aug 2012 18:28:51 +0000 (20:28 +0200)
invoice/models.py

index 4f6634c7d1e13b0cabfc0a3c80c4d5848793a763..a73bf91e7c77c238e31d56abaaec4801457152a5 100644 (file)
@@ -62,6 +62,9 @@ class Invoice(models.Model):
     due_label = property(_due_label)
     due_days = property(_due_label)
 
+    @models.permalink
+    def get_absolute_url(self):
+        return ('invoice:invoice_view', [str(self.id)])
 
 class VAT(models.Model):
     """ Model representing different taxes to be used in Invoices"""