Hello django users,

in my model's save()-method I'd like to use model's ManyToManyField to
call other save related methods. But I can't get this work.

class Model(models.Model):
    other_models = models.ManyToManyField(OtherModel)

    def save(self):
        super(Model, self).save()
        for model in self.other_models.all():
            model.do_something()

The for loop in example is runned only after second time the save method
is called and only with other_models before the above super-save-call.
So recent changes does not take effects like I'd expect. Can someone
tell me what I'm doing wrong?

Or is this a bug?

--
Timo

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to