rohitjain-rj / django-tagging

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

Adding atrributes to Tag model #221

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi -

It's very well possible that my lack of Python knowledge is causing this, 
but I was wondering whether it would be possible to add extra attributes 
to the Tag model without having to touch the django-tagging source code.

I would like to be able to attach a 'colour' attribute to my tags.

Thanks in advance,

Mathieu

Original issue reported on code.google.com by Laun...@gmail.com on 29 Oct 2009 at 2:52

GoogleCodeExporter commented 9 years ago
I was thinking, maybe an AbstractTag class (with the methods & properties Tag 
now 
has) would be an idea? Tag could be added to tagging.models as a simple 
subclass, 
inheriting all of AbstractTag, but users could then just import 
models.AbstractTag 
and do as they please (for instance add language, colours, and other properties 
or 
methods).

Original comment by Laun...@gmail.com on 1 Nov 2009 at 7:43

GoogleCodeExporter commented 9 years ago
heya,

I'm trying to do something similar. We're using django-tagging in a simple app, 
where 
we have a bunch of "publications", which has multiple tags associated with them 
(e.g. 
"firms" is a tag, "categories" is a tag etc.) And for each of those tags, we 
want an 
optional rating - basically an additional field associated with each tag.

http://groups.google.com/group/django-
users/browse_thread/thread/5831021309afba18/a6d7ca41bd5c95d4?
lnk=gst&q=tagging#a6d7ca41bd5c95d4

So basically, I was looking for an extensible/supported way of adding an 
arbitrary 
field to each tag, yet still keeping the functionality of django-tagging, all 
without 
creating an ugly fork.

Anybody know of a way to do this, or it's something that has to be coded in?

Cheers,
Victor

Original comment by victorh...@gmail.com on 6 Apr 2010 at 7:44