On 13-10-11 23:57, Andriyko wrote:

class Article(models.Model):
     ......
    # with django 1.2 was
        @models.permalink
     def get_absolute_url(self):
         return ('article_detail', (), {  'year':
self.pub_date.strftime("%Y"),
                                          'month':
self.pub_date.strftime("%m").lower(),
                                          'day':
self.pub_date.strftime("%d"),
                                          'slug': self.slug })
    # how should it look with django 1.3 ??????

Your get_absolute_url() returns a tuple instead of a url.
You forgot to call reverse():

from django.core.urlresolvers import reverse

...
    def get_absolute_url(self):
        return reverse('article_detail', (), {  'year':
               ^^^^^^^
            ...

That's probably it.


Reinout - class based views are great - van Rees

--
Reinout van Rees                    http://reinout.vanrees.org/
[email protected]             http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to