Hi.  Sorry to botther the group again.  I'm working through the Weblog
example in 'Practical Django Projects'.  Yet again, reverse URL lookup
errors prove to be the hardest to debug.  In class Entry I have
defined

    def get_absolute_url(self):
        return "/weblog/%s/%s/" % (self.pub_date.strftime("%Y/%m/%d"),
self.slug)

(Not good  style, I know, but you have to start somewhere.)

In template entry_archive.html, I've tried the following three ways of
getting the URL for a particular entry:

  <p><a href="{% url entry.get_absolute_url %}">Read full entry...</
a></p>
  <p><a href="{% url entry_detail entry.pub_date|date:"y/m/
d",entry.slug %}">Read full entry...</a></p>
  <p><a href="/weblog/{{ entry.pub_date|date:"Y/m/d" }}/
{{ entry.slug }}/">Read full entry...</a></p>

The first of these fails with the error message:

TemplateSyntaxError at /weblog/
Caught an exception while rendering: Reverse for
'weblog.entry.get_absolute_url' not found.

The second fails with a similar entry.  But the third method works.
(I know it's bad style - hence my question.)

So can anyone explain what I am doing wrong, please?

I have defined the app Coltrane at the same level in the file system
as the project Weblog.  Is it significant that the error message
refers ti weblog.entry and not coltrane.entry?  That also looks wrong
to me.

This is with version 1.0-beta_1-SVN-8430.

Thanks.
Rodney
--~--~---------~--~----~------------~-------~--~----~
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