mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-05-16 22:01:08 +00:00
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.
6 lines
178 B
Python
6 lines
178 B
Python
from model_utils.managers import SoftDeletableQuerySet
|
|
|
|
|
|
class CustomSoftDeleteQuerySet(SoftDeletableQuerySet):
|
|
def only_read(self):
|
|
return self.filter(is_read=True)
|