-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SafeDeleteMixin is not a mixin #55
Comments
I agree. |
I believe the previous way to use the mixin was like this:
I just got updated by unpinned dependencies and hit an issue where |
@thenewguy did you find a solution? I hit the same issue. I got the Mixin replacement: class SafeDeleteMixin(safedelete.models.SafeDeleteMixin):
_safedelete_policy = SOFT_DELETE # replace by whatever you want
_safedelete_visibility = DELETED_VISIBLE_BY_FIELD # replace by whatever you want
class Meta:
abstract = True but the next problem I faced is making the database migration - the |
@thenewguy the example is pretty clear on how to use the new "Mixin". Inherit from @Iftahh It should be easy to populate from |
Yes indeed I completely forgot about documenting the migration. Sorry about that. I'm really busy these days, I'll do that ASAP but I don't know when it will be. You can pin on 3.5 in the meantime. |
@AndreasBackx yes, the logic is simple but still its not as easy as "normal" Django migrations - you have to add a column of type datetime (eg. |
The name
SafeDeleteMixin
seems to say that the class is a Mixin when it's not because it inherits fromdjango.db.models
. Wouldn'tSafeDeleteModel
be a better name in this case? It clears up some confusion regarding inheritance.The text was updated successfully, but these errors were encountered: