On Sun, 2007-02-25 at 20:55 +0100, Lawrence Oluyede wrote:
> I tried to use the new permalink decorator to decouple the model from
> the urlconf structure but it doesn't work correctly. Here's an
> example:
> 
>     def get_absolute_url(self):
>         return "/foo/%d" % self.id
> 
> changed to:
> 
>     def get_absolute_url(self):
>         return ('path.of.the.correct.view', str(self.id))
>     get_absolute_url = permalink(get_absolute_url)
> 
> And what I get from the latter is "/foo/1" instead of "/foo/13"

I have a feeling somebody pointed this out in a ticket just recently,
too. We're treating something as a sequence when we shouldn't
necessarily be. I'll track it down this evening and either fix the docs
or the code.

As an intermediate fix, pass in [str(self.id)] or (str(self.id),) and I
suspect it will work.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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