List Info

Thread: Re: get_absolute_url not working as expected




Re: get_absolute_url not working as expected
user name
2007-12-17 16:03:10

On Dec 17, 6:36 pm, Florian Lindner <mailingli...xgm.de> wrote:
>
> my code in the model:
>
>         def get_absolute_url(self):
>                 return self.id
>
> Anyone else got an idea? I would send anyone any code
he requests...
>
Are you sure your code is indented right, e.g. did you mix
spaces and
tabs? Did you try to raise an exception in the method? A
simple
`assert False` before `return self.id` should do.

If that does not get you any further, could you paste your
complete
model on dpaste.com?

Regards,

Jan Rademaker


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


Re: get_absolute_url not working as expected
country flaguser name
Germany
2007-12-17 16:12:55

Am 17.12.2007 um 23:03 schrieb Jan Rademaker:

>
>
> On Dec 17, 6:36 pm, Florian Lindner
<mailingli...xgm.de> wrote:
>>
>> my code in the model:
>>
>>        def get_absolute_url(self):
>>                return self.id
>>
>> Anyone else got an idea? I would send anyone any
code he requests...
>>
> Are you sure your code is indented right, e.g. did you
mix spaces and
> tabs? Did you try to raise an exception in the method?
A simple
> `assert False` before `return self.id` should do.

Yes, it was really a tab/whitespace problem. I've switched
to Mac OS  
about a month ago and I'm not yet familiar with the editor I
choose.

Thanks a lot!

Florian

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


Re: get_absolute_url not working as expected
user name
2007-12-17 16:19:24
> If that does not get you any further, could you paste
your complete
> model on dpaste.com?

Never mind dpaste, just post to this group.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )