Commit cf7a906a authored by fred's avatar fred

add get_absolute_url method to newsletter objects

parent c067c7df
...@@ -12,6 +12,7 @@ from email.mime.text import MIMEText ...@@ -12,6 +12,7 @@ from email.mime.text import MIMEText
import html2text import html2text
from django.db import models from django.db import models
from django.core.urlresolvers import reverse
from django.template import loader, Context from django.template import loader, Context
from django.conf import settings from django.conf import settings
...@@ -96,3 +97,6 @@ class Newsletter(models.Model): ...@@ -96,3 +97,6 @@ class Newsletter(models.Model):
self.expedition_datetime = datetime.datetime.now() self.expedition_datetime = datetime.datetime.now()
self.save() self.save()
def get_absolute_url(self):
return reverse('newsletter-view', kwargs={'pk': self.id})
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment