Dear Django Users,

I have been running into a problem with the app I am developing and I
haven't been able to find a good solution. Suppose I have the following
model:

class MyModel(models.Model):
    a = models.CharField(max_length=255, null=True, blank=True)
    b = models.ForeignKey('MyOtherModel', null=True, blank=True,
on_delete=models.SET_NULL)
    # some more model fields

The task I am trying to accomplish is the following: If an instance of
"MyOtherModel" is deleted, a and b of the related MyModel-instance
should be set to NULL in the database, but the instance of MyModel with
the other fields should remain. The model above only sets b to NULL but
not a.

Any ideas?

Regards,

Jann

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6f008e52-3e3e-484b-8bca-ec6c1ef263bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to