Question

I'd like to categorize my tags. Here's an example of the tags I have now:

css, internet-explorer, firefox, floats

Each of those are separate tags ( 4 in total obviously ). I would like to mark the internet-explorer and firefox tags as browsers. Does django-tagging offer some sort of way for doing this or do I have to manually edit the schema?

I really don't care if I have to either tag tags or add a new column to the tags table, whichever is the easiest way in accordance with the plugin.

Was it helpful?

Solution

Interesting, I came across this problem as well and solved it like this. I don't want to mess with the django-tagging code because it will be a pain if I wish to upgrade afterwards, so I made a new module called taggingtools. Taggingtools is for grouping tags and autocompletion in the admin interface. For the grouping I made a new model named TagGroup, this model just has a name. (for Example browsers). I also added some functions to return the tags for that group. I then added the tags for Browsers to the Browsers TagGroup. This way I can say I want all the browser tags for a certain database object. It's easy to make this, but if you can wait I can check if I can opensource it so you and others don't have to build it yourself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top