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

Paranoid not removing deleted when querying on previous queryset #19

Open
DarknessRdg opened this issue Mar 30, 2020 · 0 comments
Open
Labels
bug Something isn't working

Comments

@DarknessRdg
Copy link
Owner

DarknessRdg commented Mar 30, 2020

I ran into this problem when quering on a previous queryset.

I was creating a new queryset like this, because i need to use multiple databases.

previou_query = MyParanoid.objects.using('database2')
# once done that, a queryset is created

After get my queryset targeted to a database, i neet to query, but when i do the following, django paranoid also filters deleted instances

query1 = previous_query.filter()
# includes deleted instances

To fixe i needed to explicit pass parameter with_deleted like this:

query1 = previous_query.filter(with_deleted=False)
# excludes deleted instances

query1 = previous_query.filter(with_deleted=True)
# includes deleted instances
@DarknessRdg DarknessRdg added the bug Something isn't working label Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant