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

Soft deleted entries are returned by default #63

Open
waza-ari opened this issue Apr 26, 2024 · 1 comment
Open

Soft deleted entries are returned by default #63

waza-ari opened this issue Apr 26, 2024 · 1 comment
Labels
FastCRUD Methods Related to FastCRUD methods help wanted Extra attention is needed

Comments

@waza-ari
Copy link

Describe the bug or question
As far as I can tell, the soft delete columns are not taken into account when returning entries from the database using any of the get methods.

Description
When using the soft delete columns, they are set correctly when using the FastCRUD.delete() method. When retrieving objects however, it is not taken into account whether the object was soft deleted or not. Maybe this is an intentional design choice and wrong expectations on my side, but I was assuming that by default soft deleted objects would not be returned, potentially with an option to return them by using a parameter.

@igorbenav
Copy link
Owner

It was an intentional design choice, I'm not sure if it's the most intuitive. If by default it excluded is_deleted=True, I think it would add complexity for the other cases (if you want to retrieve all of them and specially if you want to retrieve only deleted records).

For the second case we could end up with something like:

crud.get(db=db, return_deleted=True, is_deleted=True)

And we'd still need to deal with a case like:

crud.get(db=db, return_deleted=True, is_deleted=False)

In any case, I'd like to hear more opinions on this.

@igorbenav igorbenav added help wanted Extra attention is needed FastCRUD Methods Related to FastCRUD methods labels Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FastCRUD Methods Related to FastCRUD methods help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants