mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
Move CustomSoftDeleteQuerySet to tests.models
The `CustomSoftDeleteQuerySet` class was the only code left in the `test.managers` module, while it is not in fact a `Manager`.
This commit is contained in:
parent
68a4c14c74
commit
800961626a
2 changed files with 6 additions and 7 deletions
|
|
@ -1,6 +0,0 @@
|
|||
from model_utils.managers import SoftDeletableQuerySet
|
||||
|
||||
|
||||
class CustomSoftDeleteQuerySet(SoftDeletableQuerySet):
|
||||
def only_read(self):
|
||||
return self.filter(is_read=True)
|
||||
|
|
@ -14,6 +14,7 @@ from model_utils.managers import (
|
|||
JoinManager,
|
||||
QueryManager,
|
||||
SoftDeletableManager,
|
||||
SoftDeletableQuerySet,
|
||||
)
|
||||
from model_utils.models import (
|
||||
SoftDeletableModel,
|
||||
|
|
@ -24,7 +25,6 @@ from model_utils.models import (
|
|||
)
|
||||
from model_utils.tracker import FieldTracker, ModelTracker
|
||||
from tests.fields import MutableField
|
||||
from tests.managers import CustomSoftDeleteQuerySet
|
||||
|
||||
|
||||
class InheritanceManagerTestRelated(models.Model):
|
||||
|
|
@ -352,6 +352,11 @@ class SoftDeletable(SoftDeletableModel):
|
|||
all_objects: ClassVar[Manager[SoftDeletable]] = models.Manager()
|
||||
|
||||
|
||||
class CustomSoftDeleteQuerySet(SoftDeletableQuerySet):
|
||||
def only_read(self):
|
||||
return self.filter(is_read=True)
|
||||
|
||||
|
||||
class CustomSoftDelete(SoftDeletableModel):
|
||||
is_read = models.BooleanField(default=False)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue