Skip to content

Instantly share code, notes, and snippets.

View jacopsd's full-sized avatar

Davy jacopsd

  • Belgium
  • 12:30 (UTC +02:00)
View GitHub Profile
from django.core.cache import cache
from django.conf import settings
from django.contrib.auth.models import User
ONLINE_THRESHOLD = getattr(settings, 'ONLINE_THRESHOLD', 60 * 15)
ONLINE_MAX = getattr(settings, 'ONLINE_MAX', 50)
def get_online_now(self):
return User.objects.filter(id__in=self.online_now_ids or [])