flebel / django-tagging

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

Multiple TagFields / Tag Types in One Model #115

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
As the django-tagging framework is set up now, one cannot have multiple tag
types in the same model. A simplified example of where this would be useful
is a grammar/lingual critique site with articles.

In this example these articles could have descriptor tags to find general
things about the article, "good" tags to signify good examples of grammar
or style, and "bad" tags to signify poor examples. For further example an
article might be a short story about the first day of school. In it there
were good examples of metaphor, and bad examples of dangling modifiers. In
this case one could tag the article:
Description tags: story, school
Good tags: metaphor
Bad tags: "dangling modifier"

The model contstruct could be:

class article(models.Model):
   title            = models.CharField(max_length=200)
   ...

   description_tags = TagField()
   good_tags        = TagField()
   bad_tags         = TagField()

Which, if I'm reading correctly, would just use the description tags to
return reference calls to an article object. One way discussed to do this
would be to change the Tag object to include a type, but this would require
plenty of changes to the SQL statements. I'm not sure that's something to
be taken lightly especially with the query-refactor branch on the horizon
(which it looks like you will take the opportunity to change the lookups
anyway at that date). 

I would just like to see what your thoughts were on this and whether it's
something to look into/take into account.

Original issue reported on code.google.com by steveapp...@gmail.com on 13 Apr 2008 at 5:48

GoogleCodeExporter commented 9 years ago
Ahh yes, I am going to have this same problem.  I am attempting to build a sort 
of
ontology and thus, I want to be able to tag multiple ways such as you describe 
above
and thus this is an issue for me too.  Is there someway to extract more 
information
from content type?

Original comment by dcur...@gmail.com on 26 Jul 2008 at 7:47

GoogleCodeExporter commented 9 years ago
I'm having this problem as well. I've got a list of public and private tags. I 
want to relate the objects against each 
other with these tags, but I don't necessarily want my users to know that I'm 
using some tags.

Original comment by peter.pi...@gmail.com on 10 Mar 2009 at 5:52

GoogleCodeExporter commented 9 years ago
I also have the same problem. I need to be able to define generic tags and then 
a number of more specific 'sets' 
of tags. Is there any work around to this??

Original comment by rawjam.d...@googlemail.com on 19 Aug 2009 at 8:25

GoogleCodeExporter commented 9 years ago
attached is a hacky workaround, using the TagSelectField from here: 
http://code.google.com/p/django-
tagging/issues/detail?id=189#c3
sorry for the exec's! suggestions on avoiding them?

Original comment by ammac...@gmail.com on 1 Nov 2009 at 9:06

Attachments: