def save(self, *args, **kwargs): """Save object with central time.""" self.last_updated = get_now_datetime_cst() super(Player, self).save(*args, **kwargs)
def get_all_by_recent_activity(minutes=30): """Return all Players recently active.""" central_now = get_now_datetime_cst() players = Player.objects.filter(last_updated__gte=(central_now - timedelta(minutes=minutes))) return players
def get_all_by_recent_activity(minutes=30): """Return all Players recently active.""" central_now = get_now_datetime_cst() players = Player.objects.filter( last_updated__gte=(central_now - timedelta(minutes=minutes))) return players