def queryset(self, request, queryset): if self.value() in ('0', '1'): result = [ team.id for team in queryset if queries.eligible(team) == (self.value() == '1') ] return queryset.filter(id__in=result)
def log_registration(request, team, new): eligible = "eligible" if queries.eligible(team) else "ineligible" message = _format_request(request) if new: ip_logger.info("register new {} team: {}".format(eligible, message)) else: ip_logger.info("join old {} team: {}".format(eligible, message))
def queryset(self, request, queryset): if self.value() in ('0', '1'): result = [team.id for team in queryset if queries.eligible(team) == (self.value() == '1')] return queryset.filter(id__in=result)
def eligible(self, team): return queries.eligible(team)
def eligible(team): return queries.eligible(team)