jinjie2088 / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

Support for get_absolute_url for Tag object #126

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm not sure if this would need to be done on the Tag model or its manager. 
However, I would 
like to see get_absolute_url support for a tag. Given that we can use named 
urls and this app 
offers a generic view, this becomes not too bad with something like:

url(r'^widgets/tag/(?P<tag>[^/]+)/$',
           tagged_object_list,
           dict(model=Widget, paginate_by=10, allow_empty=True,
                template_object_name='widget'),
           name='widget_tag_detail'),

class Tag(models.Model):
    def get_absolute_url(self, tag):
        return ('widget_tag_detail', (), { 'tag': tag })

or something similar. I'm just throwing that out there. Perhaps I'm overlooking 
some snag. I'm 
sure folks might want TaggedItem also, but provided they know the model of the 
TaggedItem, 
they can build that into their tagged model.

Original issue reported on code.google.com by aez...@gmail.com on 22 May 2008 at 12:40

GoogleCodeExporter commented 9 years ago
I'd love to see support for this, too. I may write something - will post here 
if I do.

Thanks.

Original comment by intellin...@gmail.com on 5 Jun 2009 at 3:49