My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 56: Post absolute URL fails in pagination
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  May 2009


 
Reported by lu...@die.net.au, Mar 24, 2009
You can not directly access a post by the get_absolute_url method if the
thread view is paginated. As a result the 'view last post' links do not
work in the forum and thread list views.

Initially I tried adding ?page=last to the end of the links, but the post
id anchor breaks this.

/#1234?page=last does not work.
/?page=last#1234 does work.

Apr 12, 2009
#3 lu...@die.net.au
This will at least make 'view last post' work

diff --git a/models.py b/models.py
index 37d6e62..03cdda9 100644
--- a/models.py
+++ b/models.py
@@ -244,7 +244,7 @@ class Post(models.Model):
         ordering = ('-time',)
         
     def get_absolute_url(self):
-        return '%s#post%s' % (self.thread.get_absolute_url(), self.id)
+        return '%s?page=last#post%s' % (self.thread.get_absolute_url(), self.id)
     
     def __unicode__(self):
         return u"%s" % self.id

May 2, 2009
Project Member #4 rwpoul...@gmail.com
Thanks for the patch. i've checked it in, and will work on a better patch sometime
soon to handle cases like having a permalink to a post, links in e-mails, etc.

Patch added in SVN r44.
Status: Fixed

Powered by Google Project Hosting