I think it is better to show my code

This is my models's get_absoute_url function

    def get_absolute_url(self):
        return ('blog.views.tag_main', None, {'username':User.username,
'slug': str(self.Slug)})
    get_absolute_url = permalink(get_absolute_url)


This is a part of my urls.py which is equivalent to above model.

urlpatterns = patterns('blog.views',
    (r'^(?P<username>\w+)/$', 'main'),
    (r'^(?P<username>\w+)/page/(?P<page>\d+)/$', 'main'),
    (r'^(?P<username>\w+)/tag/(?P<slug>[-\w]+)/$', 'tag_main'),
    (r'^(?P<username>\w+)/id/(?P<id>\d+)/$', 'entry_detail'),
)


On 6/29/07, Young Gyu Park <[EMAIL PROTECTED]> wrote:
>
>
> I try to get the proper get_absolute_url.
>
> Under the this circumstances.
>
> I have username parameter in my URL.
>
> like this http://.../(?<username> .....
>
> I need to pass this username parameter to the get_absolute_url function.
>
> But I don't know how to get the proper username. Because the User model is
> out of the the model where I manage the get_absolute_url.
>
> Can you have any clue? or Is there anyone who have experienced the similar
> this?
>
> Thanks always.
>

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