Monday, April 29, 2013

Re: quick problem with str and int

How about adding a get_absolute_url method to your model? Then you can take care of the logic there, instead of the template.

Worst-case, you can just do the conversion in your view and assign it as a new property to your model. Since it's just a Python class instance, you can do my_obj.temp_url = (whatever) and then your template can access my_obj.temp_url. 

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment