question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SafeDeleteMixin is not a mixin

See original GitHub issue

The name SafeDeleteMixin seems to say that the class is a Mixin when it’s not because it inherits from django.db.models. Wouldn’t SafeDeleteModelbe a better name in this case? It clears up some confusion regarding inheritance.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thenewguycommented, Jan 17, 2017

I believe the previous way to use the mixin was like this:

from safedelete.models import safedelete_mixin_factory, SOFT_DELETE
SoftDeleteMixin = safedelete_mixin_factory(SOFT_DELETE)

I just got updated by unpinned dependencies and hit an issue where safedelete_mixin_factory is no longer included at safedelete.models.safedelete_mixin_factory but there are no docs that indicate the correct way to migrate from this pattern

0reactions
Iftahhcommented, Jan 23, 2017

@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. deleted_temp) populate it, remove the old deleted and rename the deleted_temp to deleted. Still after that was done I had different unit tests failures that I decided to just revert the database and freeze version to 0.3.2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Model — django-safedelete 0.4 documentation - Read the Docs
Args: keep_deleted: Do not undelete the model if soft-deleted. (default: {False}) kwargs: Passed ... SafeDeleteModel was previously named SafeDeleteMixin .
Read more >
mixin and @include - Sass
A mixin's name can be any Sass identifier, and it can contain any ... the mixin as a map from argument names (not...
Read more >
SASS - Why is this mixin not being included? - Stack Overflow
It is being included but you're just not calling it. % is a placeholder selector so you need to @extend %my-placeholder after you...
Read more >
Using JavaScript Mixins The Good Parts - DEV Community ‍ ‍
When NOT to use a Mixin. You may think now "dam that is powerful" and you are right. Should we use it now...
Read more >
Documentation - Mixins - TypeScript
Using the mixin pattern with TypeScript. ... Mixins may not declare private/protected properties. // however, you can use ES2020 private fields. _scale =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found