[open-ils-commits] r24 - servres/trunk/conifer/syrup
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Nov 19 12:41:04 EST 2008
Author: artunit
Date: 2008-11-19 12:41:00 -0500 (Wed, 19 Nov 2008)
New Revision: 24
Modified:
servres/trunk/conifer/syrup/models.py
Log:
Modified: servres/trunk/conifer/syrup/models.py
===================================================================
--- servres/trunk/conifer/syrup/models.py 2008-11-18 21:09:21 UTC (rev 23)
+++ servres/trunk/conifer/syrup/models.py 2008-11-19 17:41:00 UTC (rev 24)
@@ -1,5 +1,6 @@
from django.db import models as m
from django.contrib.auth.models import User
+from django.contrib.auth.models import AnonymousUser
from datetime import datetime
#----------------------------------------------------------------------
@@ -13,6 +14,15 @@
# can be made available on the User that are not part of the Django
# User model. Let's try this for a bit see how this works out.
+class AnonymousUserExtensionHack(object):
+ def unmoderated_courses():
+ return Course.objects.filter(moderated=False)
+
+for k,v in [(k,v) for k,v in AnonymousUserExtensionHack.__dict__.items() \
+ if not k.startswith('_')]:
+ setattr(AnonymousUser, k, v)
+
+
class UserExtensionHack(object):
def courses(self):
return Course.objects.filter(member__user=self.id)
@@ -53,6 +63,7 @@
max_length=4098,
blank=True, null=True)
active = m.BooleanField(default=True)
+ moderated = m.BooleanField(default=False)
def __unicode__(self):
return self.code or self.title
More information about the open-ils-commits
mailing list