diff options
author | luxagraf <sng@luxagraf.net> | 2017-01-01 17:05:13 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2017-01-01 17:05:13 -0500 |
commit | 28326ead44ca96beaab45da7976b488c156ca0f2 (patch) | |
tree | fbeccef4125af97d3f09f9215b24d2f77959c834 /app | |
parent | 837a5a7382c2a1260d6d208a3ce2c6be815c1e7d (diff) |
added prev and next links to jrnl change form
Diffstat (limited to 'app')
-rw-r--r-- | app/jrnl/models.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/jrnl/models.py b/app/jrnl/models.py index da953de..a918f6e 100644 --- a/app/jrnl/models.py +++ b/app/jrnl/models.py @@ -152,11 +152,22 @@ class Entry(models.Model): @property def get_previous_published(self): return self.get_previous_by_pub_date(status__exact=1) + + @property + def get_previous_admin_url(self): + n = self.get_previous_by_pub_date() + return "/admin/jrnl/entry/%s/change/" % n.pk + @property def get_next_published(self): return self.get_next_by_pub_date(status__exact=1) + @property + def get_next_admin_url(self): + n = self.get_next_by_pub_date() + return "/admin/jrnl/entry/%s/change/" % n.pk + def save(self): if self.pk: if self.pk >= 167 or self.pk == 129: |