+ def __str__(self):
+ return u'tow. ' + str(self.user)
+
+ @classmethod
+ def is_active_for(self, user):
+ if user.is_anonymous:
+ return False
+ return Schedule.objects.filter(
+ models.Q(expires_at=None) | models.Q(expires_at__lt=now()),
+ membership__user=user,
+ is_active=True,
+ ).exists()