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

Add return value to MockSet delete #154

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arielbello
Copy link

The behavior for the QuerySets delete in Django is to return a tuple with the number of entries deleted, and a dictionary with how many entries were deleted for each type.
This PR aims to simulate that behavior.


if self.clone is not None:
self.clone._delete_recursive(*items_to_remove, **attrs)

return sum_deleted, items_deleted
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you dont need to store a sum_deleted variable.
You can just use return sum(items_delete.values()), items_deleted

@stefan6419846
Copy link
Collaborator

What is the current status of this PR?

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

Successfully merging this pull request may close these issues.

None yet

3 participants