Maybe you can get a better description / traceback of the error from
the shell. Something like

python manage.py shell
>> from myapp.models import Post
>> p = Post.objects.all()[0]
>> p.get_absolute_url()

hth,
Nuno

On Tue, Jul 20, 2010 at 4:46 AM, vcarney <[email protected]> wrote:
> I'm having a problem getting a permalink to render an absolute url.
> Here is my template code:
>
> <h3 class="title"><a
> href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
>
> In models.py I have a Post class with:
>
> @models.permalink
>    def get_absolute_url(self):
>        return ('vblog_detail_month_numeric', (), {
>            'year': self.publish.year,
>            'month': self.publish.strftime('%m').lower(),
>            'day': self.publish.day,
>            'slug': self.slug
>        })
>
> Here is where I have a named url:
>
> url(r'^(?P<year>\d{4})/(?P<month>\d{1,2})/(?P<day>\d{1,2})/(?P<slug>[-
> \w]+)/$',
>        view=vblog_views.post_detail,
>        name='vblog_detail_month_numeric'),
>
> My post_detail function starts with:
>
> def post_detail(request, slug, year, month, day, **kwargs):
>
> The post title always gets a blank href url returned in <a
> href="{{ post.get_absolute_url }}">
>
> --
> 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.
>
>

-- 
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.

Reply via email to