[virtualcommons-svn] commit/vcweb: alllee: adding icon ImageField to Activity (adds PIL dependency,
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-07-07 20:40:50
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/5116b3dc5612/ changeset: 5116b3dc5612 user: alllee date: 2011-07-07 22:40:52 summary: adding icon ImageField to Activity (adds PIL dependency, you'll need to run pip install PIP for syncdb to work properly) and configuring MEDIA_ROOT/MEDIA_URL affected #: 3 files (91 bytes) --- a/vcweb/lighterprints/models.py Thu Jul 07 02:03:36 2011 -0700 +++ b/vcweb/lighterprints/models.py Thu Jul 07 13:40:52 2011 -0700 @@ -16,7 +16,8 @@ # FIXME: allow for experiment-configurable levels? level = models.PositiveIntegerField(default=1) group_activity = models.BooleanField(default=False, help_text='Whether or not this activity has beneficial group effect multipliers, e.g., ride sharing') - cooldown = models.PositiveIntegerField(default=1, help_text='How much time, in hours, must elapse before this activity can become available again') + cooldown = models.PositiveIntegerField(default=1, null=True, blank=True, help_text='How much time, in hours, must elapse before this activity can become available again') + icon = models.ImageField(upload_to='lighterprints/activity-icons/') @property def label(self): @@ -28,8 +29,7 @@ @property def icon_url(self): - # FIXME: implement as return "/activity/id/icon" - pass + return self.icon.url def __unicode__(self): return u'%s (+%s)' % (self.label, self.savings) --- a/vcweb/requirements.pip Thu Jul 07 02:03:36 2011 -0700 +++ b/vcweb/requirements.pip Thu Jul 07 13:40:52 2011 -0700 @@ -8,6 +8,7 @@ django-kombu django-dajaxice django-autocomplete +PIL #django-unittest-depth #redis #beanstalkc --- a/vcweb/settings.py Thu Jul 07 02:03:36 2011 -0700 +++ b/vcweb/settings.py Thu Jul 07 13:40:52 2011 -0700 @@ -33,16 +33,7 @@ # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. -USE_I18N = False - -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -#MEDIA_ROOT = '' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -#MEDIA_URL = '/static/' +USE_I18N = True # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. Default is '/static/admin/' @@ -135,6 +126,15 @@ path.join(path.abspath(path.dirname(__file__)), 'static').replace('\\', '/'), ) +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = path.join(STATIC_ROOT, 'media') + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '/static/media/' + # set up jquery-ui css classes for django messages MESSAGE_TAGS = { Repository URL: https://bitbucket.org/virtualcommons/vcweb/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |