mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-17 12:20:23 +00:00
* Modernize Python syntax, add Python 3.8 * Update Python version & dist in TravisCI * Add postgresql as addon * Switch to psycopg2-binary * Drop django.utils.six
13 lines
375 B
Python
13 lines
375 B
Python
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()
|