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

Using the "deleted" field in Filter does not seem to work #81

Open
us24man opened this issue Sep 16, 2021 · 1 comment
Open

Using the "deleted" field in Filter does not seem to work #81

us24man opened this issue Sep 16, 2021 · 1 comment

Comments

@us24man
Copy link

us24man commented Sep 16, 2021

When using the filter method the "deleted__isnull" is not working. I have foreign key relations in the table which are already not handled by default. So i tried to handle it manually via the filter method.
count = feed.service.filter(deleted__isnull=True).count()
The deleted field is showing up in the table and the deleted method does soft delete the record.

@PratikBodawala
Copy link
Contributor

Hello,

"deleted" is a property of the SoftDeleteObject model. What you want is "deleted_at__isnull". because "deleted_at" is a field.

deleted property reference:

deleted = property(get_deleted, set_deleted)

deleted_at field reference:

deleted_at = models.DateTimeField(

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

2 participants