mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-17 04:10:24 +00:00
13 lines
375 B
Python
13 lines
375 B
Python
from model_utils.managers import SoftDeletableManager, SoftDeletableQuerySet
|
|
|
|
|
|
class CustomSoftDeleteQuerySet(SoftDeletableQuerySet):
|
|
def only_read(self):
|
|
return self.filter(is_read=True)
|
|
|
|
|
|
class CustomSoftDeleteManager(SoftDeletableManager):
|
|
_queryset_class = CustomSoftDeleteQuerySet
|
|
|
|
def only_read(self):
|
|
return self.get_queryset().only_read()
|