Coverage for tictactoe/tools/models: 50%

# Coverage for tictactoe/tools/models : 50%

## 14 statements 7 run 7 missing 0 excluded

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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | from django.db import models class OwnManager(models.Manager): def __init__(self, key): super(OwnManager, self).__init__() self._key = key def __call__(self, user, *args, **kwargs): self._user = user return self def get_queryset(self): assert hasattr(self, '_user'), "must call Manager with user instance" if self._user.is_superuser: return super(OwnManager, self).get_queryset() d = {self._key: self._user} return super(OwnManager, self).get_queryset().filter(**d)