I'm overriding save() and delete() methods of the class models. The override
of the save() method works properly but unfortunately I'm in troubles trying
to override models.delete method. For example, I try to do that in one of my
dummy models:

class test(models.model)
    name = models.CharField(max_length=20)
    value = models.IntegerField()
    active = models.BooleanField()

    def save(self, force_insert=False, force_update=False):
        if self.active:
            new = test_active(name=self.name, value=self.value)
            new.save()
        super(test, self).save(force_insert, force_update)

    def delete(self):
         if self.active:
              active=False

class test_active(models.model)
    name = models.CharField(max_length=20)
    value = models.IntegerField()

When I delete a test object, the object is deleted although I override the
delete function :( What am I doing wrong?

Thanks in advance!!
Marc

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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