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

Auto-generate manager implementation for CustomSoftDelete #612

Merged

Conversation

mthuurne
Copy link
Contributor

@mthuurne mthuurne commented Apr 16, 2024

Besides requiring less code, this also allows the django-stubs mypy plugin to automatically generate a type-annotated version of the manager.

Name the manager available_objects because objects is deprecated in SoftDeletableModel.

@mthuurne mthuurne mentioned this pull request Apr 16, 2024
Besides requiring less code, this also allows the django-stubs
mypy plugin to automatically generate a type-annotated version
of the manager.

Unfortunately, the plugin does not put a `ClassVar` annotation
on `objects`, which is why we need the suppression.
The `CustomSoftDeleteQuerySet` class was the only code left in
the `test.managers` module, while it is not in fact a `Manager`.
Use the `available_objects` manager instead.
@mthuurne mthuurne force-pushed the generate-custom-soft-delete-manager branch from 14ac0b4 to 512d0f1 Compare April 16, 2024 02:02
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.93%. Comparing base (c75e54a) to head (512d0f1).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #612      +/-   ##
==========================================
- Coverage   98.94%   98.93%   -0.01%     
==========================================
  Files           6        6              
  Lines         757      750       -7     
==========================================
- Hits          749      742       -7     
  Misses          8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@foarsitter foarsitter left a comment

Choose a reason for hiding this comment

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

Only touches the tests, Thanks again!

@foarsitter foarsitter merged commit ba9ac5d into jazzband:master Apr 17, 2024
9 checks passed
@mthuurne mthuurne deleted the generate-custom-soft-delete-manager branch April 17, 2024 13:16
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

2 participants