Skip to content

Auto-generate manager implementation for CustomSoftDelete#612

Merged
foarsitter merged 3 commits intojazzband:masterfrom
ProtixIT:generate-custom-soft-delete-manager
Apr 17, 2024
Merged

Auto-generate manager implementation for CustomSoftDelete#612
foarsitter merged 3 commits intojazzband:masterfrom
ProtixIT:generate-custom-soft-delete-manager

Conversation

@mthuurne
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
@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.

2 participants