Commit ee63244073e19244714327d1adce57dc096b3d3c add weakforeignkey in to "emulate sql ON DELETE SET NULL using WeakForeignKey and enhanced model/manager/queryset"
For example, if you have a nullable ForeignKey and you want it to be set null when the referenced object is deleted:
user = models.ForeignKey(User, blank=True, null=True, on_delete=models.SET_NULL)
Todo :
remove WeakForeignKey class
modifiy every models using WeakForeignKey by adding the option on_delete=models.SET_NULL.
EnhancedQuerySet, EnhancedManager,
and EnhancedModel in models.core.py may also not be needed any more.
@yomguy do you confirm that EnhancedQuerySet, EnhancedManager,
and EnhancedModel could be removed ? EnhancedModel is used as base-class for ModelCore but seems only to add weakforeignkey support. Is it wright ?
Commit ee63244073e19244714327d1adce57dc096b3d3c add weakforeignkey in to "emulate sql ON DELETE SET NULL using WeakForeignKey and enhanced model/manager/queryset"
See models.fields.py line 202
This feature seems obsolete as it is provided by Django. see https://docs.djangoproject.com/en/1.8/ref/models/fields/#django.db.models.ForeignKey.on_delete
Todo :
on_delete=models.SET_NULL
.@yomguy do you confirm that EnhancedQuerySet, EnhancedManager, and EnhancedModel could be removed ? EnhancedModel is used as base-class for ModelCore but seems only to add weakforeignkey support. Is it wright ?