mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-17 04:10:24 +00:00
15 lines
433 B
Python
15 lines
433 B
Python
from __future__ import unicode_literals, absolute_import
|
|
|
|
from model_utils.managers import SoftDeletableQuerySet, SoftDeletableManager
|
|
|
|
|
|
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()
|