I'm trying to make a tagging application.  I want to have tags that
have related tags, ie, if they choose the tag 'car', it should also
choose 'automobile'.  If they choose 'automobile', it should not
automatically choose 'car'.  I'm using something like:

class Tag(models.Model):
   name = models.CharField(max_length=30)
   related = models.ManyToManyField('self')

If I do this:

>>> car = Tag(name='car')
>>> car.save()
>>> automobile = Tag(name='automobile')
>>> automobile.save()
>>> car.related.add(automobile)
>>> car.related.all()
[<tag: automobile>]
>>> automobile.related.all()
[<tag: car>]

How do I make it so that if I add a relation of 'automobile' to 'car',
it doesn't automatically add a reverse relation like that?

-- 
Adam Olsen
http://www.vimtips.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to