Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Imports
3from django.db import models
5# Exports
7__all__ = (
8 "ArchivedManager",
9)
11# Managers
14class ArchivedManager(models.Manager):
15 """Automatically filters out archived records."""
17 def archived(self):
18 """Specifically select archived records."""
19 # TODO: Should archived() method use _chain() or _clone() instead of _queryset_class()?
20 qs = self._queryset_class(model=self.model, using=self._db, hints=self._hints)
21 return qs.filter(is_archived=True)
23 def unarchived(self):
24 """Specifically select unarchived records."""
25 return super().get_queryset().filter(is_archived=False)