You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Musician(models.Model):
instrument = models.CharField(max_length=100)
class Album(models.Model):
artist = models.ForeignKey(
'app.Musician',
on_delete=models.PROTECT
)
Order matters for cleaning models
For example
from dj_anonymizer import register_models
register_models.register_clean([
Musician, Album
])
Will raise
django.db.models.deletion.ProtectedError: ("Cannot delete some instances of model 'Musician' because they are referenced through a protected foreign key: ...
And in case
from dj_anonymizer import register_models
register_models.register_clean([
Album, Musician
])
All will be good
The text was updated successfully, but these errors were encountered:
In cases like
Order matters for cleaning models
For example
Will raise
And in case
All will be good
The text was updated successfully, but these errors were encountered: