Krizsán Balazs
Krizsán Balazs

Reputation: 385

Django-tagging 2 tag field in same model

I'm using django-tagging. It works fine when I want 1 tag collection for the model. But now i need to use 2 different collections, somehow like this:

class Compare(models.Model):
    title = models.CharField(max_length=255)

    left_tags  = TagField()
    right_tags = TagField()

Is it possible with tagging? I hope somebody has an example and will share it! Thanks! :)

Upvotes: 0

Views: 390

Answers (1)

Francis Yaconiello
Francis Yaconiello

Reputation: 10939

does TagField take a optional related_name attribute you could use?

https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.related_name

I've never used this app myself, but thats the django-ish way of solving this.

Upvotes: 2

Related Questions