Skip to content
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

ENTRY: django manager objects all_objects #38

Open
zodman opened this issue Feb 1, 2019 · 0 comments
Open

ENTRY: django manager objects all_objects #38

zodman opened this issue Feb 1, 2019 · 0 comments

Comments

@zodman
Copy link

zodman commented Feb 1, 2019

This features its not documented but it works

When you implement softdelete (logic delete). On the admin show all objects but on the app not show the objects deleted.

class CustomManager(models.Manager):
      def get_queryset(self):
            qs = super().get_queryset()
            return qs.filter(is_deleted=True)

class Model1(models.Model):

      all_objects = models.Manager()
      objects = CustomManager()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant