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.models import Manager
5# Exports
7__all__ = (
8 "OwnedByManager",
9)
11# Managers
14class OwnedByManager(Manager):
15 """Manage records that are "owned" by a user.
17 .. code-block:: python
19 class Task(OwnedByModel):
20 objects = OwnedByManager()
22 my_tasks = Task.objects.owned_by(user)
24 """
26 def owned_by(self, user):
27 return self.get_queryset().filter(owned_by=user)