[virtualcommons-svn] commit/vcweb: alllee: fixes issue 27 and adding icon_url to json output
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-07-07 20:50:25
|
1 new changeset in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/9254eb564480/ changeset: 9254eb564480 user: alllee date: 2011-07-07 22:50:26 summary: fixes issue 27 and adding icon_url to json output affected #: 2 files (45 bytes) --- a/vcweb/lighterprints/models.py Thu Jul 07 13:46:26 2011 -0700 +++ b/vcweb/lighterprints/models.py Thu Jul 07 13:50:26 2011 -0700 @@ -29,7 +29,7 @@ @property def icon_url(self): - return self.icon.url + return self.icon.url if self.icon else "" def __unicode__(self): return u'%s (+%s)' % (self.label, self.savings) --- a/vcweb/lighterprints/views.py Thu Jul 07 13:46:26 2011 -0700 +++ b/vcweb/lighterprints/views.py Thu Jul 07 13:50:26 2011 -0700 @@ -23,8 +23,8 @@ activity_by_level[activity.level].append(activity) #activity_as_dict = collections.OrderedDict() activity_as_dict = {} - for attr_name in ('pk', 'name', 'summary', 'display_name', 'description', 'savings', 'url', 'available_all_day', 'level', 'group_activity', 'icon_url'): - activity_as_dict[attr_name] = getattr(activity, attr_name) + for attr_name in ('pk', 'name', 'summary', 'display_name', 'description', 'savings', 'url', 'available_all_day', 'level', 'group_activity', 'icon_url', 'time_remaining'): + activity_as_dict[attr_name] = getattr(activity, attr_name, None) flattened_activities.append(activity_as_dict) context['activity_by_level'] = dict(activity_by_level) 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. |