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

chore: Replicate Django's signature at SoftDelete queryset #622

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

gmcrocetti
Copy link
Contributor

Problem

Mimics Django's API for SoftDeletableQuerySetMixin.

Solution

Django's API behaves as the following:
image

Returning a tuple of type (int, dict[str, int]) where the first element is the number of objects deleted and the second the same count but for the model itself and its relations.

The proposed solution returns the number of objects affected by the update and a made up dict where the key is model's label (no relations as we don't touch it) with aforementioned count.

Commandments

  • Write PEP8 compliant code.
  • Cover it with tests.
  • Update CHANGES.rst file to describe the changes, and quote according issue with GH-541.
  • Pay attention to backward compatibility, or if it breaks it, explain why.
  • Update documentation (if relevant).

@gmcrocetti gmcrocetti marked this pull request as ready for review June 6, 2024 18:08
@gmcrocetti gmcrocetti force-pushed the issue-541 branch 5 times, most recently from 0dbf02f to 71a1192 Compare June 30, 2024 14:45
@foarsitter foarsitter merged commit 7b091f5 into jazzband:master Aug 28, 2024
7 checks passed
@foarsitter
Copy link
Contributor

Thanks @gmcrocetti !

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.

2 participants