Hello,
I have two question regarding get_absolute_url:
1) I have the template code:
{% for entry in object_list %}
<h3><a href="{{ entry.get_absolute_url }}"> {{ entry.title }}</a></h3>
{% endfor %}
It's called from a .generic.list_detail.object_list. My
get_absolute_url is implemented in my model:
class BlogEntry(Model):
def get_absolute_url(self):
return self.id
but the link in the template is always http://localhost:8000/blog/
where blog is my application name and which is also the URL used to
get to the template above. I can even return anything (like a constant
string) but it's not being taken into account, the link is also the
same. What is wrong there?
2) As the name says get_absolute_url should always return a absolute
URL (which I understand is a complete URL). Is there a standard way to
produce such a URL? For example I need to my server (here is localhost:
8000) and the path to application (blog/).
Thanks,
Florian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---