I have a model in which I'm using the GenericRelation model for
tagging.
Here I'm using tagging purely as a method for structuring content
throughout the global site, its not ment for users to tag objects.

Since the GenericRelation isn't (yet?) fully integrated to the admin
site, I'm using a ManyToManyField to populate the GenericRelation.

postTags = models.ManyToManyField(Tag)
newTags  = models.GenericRelation(Tag)

I have a method addTags for updating the GenericRelation :

    def addTags(self):
        for i in self.tag_list():
            try:
                self.newTags.create(tag=i)
            except:
                pass

which is just fine, but the method addTags has to be called
explicitely.
what would be the most logic thing to me would be to call
self.addTags() and have the GenericRelation updated. unique_together is
specified in Tag, such that a tag won't be duplicated. Since calling
self.addTags() directly isn't an option, what's the djangthonic thing
to do here?

Thanks!

-jelle


--~--~---------~--~----~------------~-------~--~----~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to