[open-ils-commits] r48 - in servres/trunk: . conifer/syrup
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 24 22:20:03 EST 2008
Author: gfawcett
Date: 2008-11-24 22:20:02 -0500 (Mon, 24 Nov 2008)
New Revision: 48
Added:
servres/trunk/.gitignore
Modified:
servres/trunk/conifer/syrup/models.py
Log:
made Item.fileobj optional, minor doc update.
Added: servres/trunk/.gitignore
===================================================================
--- servres/trunk/.gitignore (rev 0)
+++ servres/trunk/.gitignore 2008-11-25 03:20:02 UTC (rev 48)
@@ -0,0 +1 @@
+conifer/static/uploads
Modified: servres/trunk/conifer/syrup/models.py
===================================================================
--- servres/trunk/conifer/syrup/models.py 2008-11-25 02:50:01 UTC (rev 47)
+++ servres/trunk/conifer/syrup/models.py 2008-11-25 03:20:02 UTC (rev 48)
@@ -14,6 +14,12 @@
# 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.
+# General methods that return sets of users (e.g. all instructors, all
+# staff) -- let's put those on the UserProfile class, as class
+# methods. For now, let's put personal methods (e.g. my courses) on
+# the User object (although UserProfile would be another logical
+# candidate).
+
class UserExtensionHack(object):
def courses(self):
return Course.objects.filter(member__user=self.id)
@@ -44,6 +50,7 @@
@classmethod
def active_instructors(cls):
+ """Return a queryset of all active instructors."""
return cls.objects.filter(instructor=True) \
.select_related('user').filter(user__is_active=True) \
.order_by('-user__last_name','-user__first_name')
@@ -126,6 +133,7 @@
#------------------------------------------------------------
+# ITEMS
class Item(m.Model):
"""
@@ -205,7 +213,7 @@
requested_loan_period = m.CharField(max_length=255,blank=True,default='', null=True)
fileobj = m.FileField(upload_to='uploads/%Y/%m/%d', max_length=255,
- null=True, default=None)
+ blank=True, null=True, default=None)
date_created = m.DateTimeField(auto_now_add=True)
last_modified = m.DateTimeField()
More information about the open-ils-commits
mailing list