Permalink
Browse files

New badge, good way to unlurk

  • Loading branch information...
1 parent 1b852c9 commit 80f899a9f3ba515d1706490e64522d6d45115c94 @kaleissin committed with Dec 30, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 CALS/cals/management/commands/batchbadge.py
@@ -4,7 +4,7 @@
sys.path.append('/home/python/django-sites/')
sys.path.append('/home/python/django-sites/CALS/')
-from django.db.models import Q
+from django.db.models import Q, F
from django.core.management import setup_environ
from django.core.management.base import NoArgsCommand, BaseCommand
@@ -107,6 +107,13 @@ def regulars():
old_hands = _active_year_ago(3)
batchbadge(badge, old_hands)
+def boomerangs():
+ badge = Badge.objects.get(name='Boomerang')
+ week = timedelta(days=7)
+ boomerangs = User.objects.filter(last_login__gt=F('date_joined')+week,
+ badges__isnull=False).distinct()
+ batchbadge(badge, boomerangs)
+
# -- helpers
def testbunnies():
@@ -207,6 +214,7 @@ def timetravellers():
'nudgers': nudgers,
'yearlings': yearlings,
'old_hands': old_hands,
+ 'boomerangs': boomerangs,
'timetravellers': timetravellers,
'phoneticians': phoneticians,
'regulars': regulars,

0 comments on commit 80f899a

Please sign in to comment.