>>>
... from django.db import models
... from django.utils.translation import gettext_lazy as _
...
...
... class ActiveCustomersManager(models.Manager):
... def get_queryset(self):
... return super().get_queryset().filter(is_active=True)
...
...
... class Customer(models.Model):
... firstname = models.CharField(verbose_name=_('First Name'), max_length=100, null=False, blank=False)
... lastname = models.CharField(verbose_name=_('Last Name'), max_length=100, null=False, blank=False, db_index=True)
... is_active = models.BooleanField(verbose_name=_('Is Active?'), null=False, blank=False, default=False)
...
... objects = ActiveCustomersManager()
...
... def __str__(self):
... return f'{self.firstname} {self.lastname}'
...
... class Meta:
... verbose_name = _('Customer')
... verbose_name_plural = _('Customers')