[virtualcommons-svn] commit/vcweb: 2 new changesets
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-08-30 22:04:16
|
2 new changesets in vcweb: http://bitbucket.org/virtualcommons/vcweb/changeset/e3ecfdd9c740/ changeset: e3ecfdd9c740 user: alllee date: 2011-08-31 00:02:26 summary: adding retrieve_all parameter to group activity json view affected #: 2 files (172 bytes) --- a/vcweb/lighterprints/models.py Mon Aug 22 16:24:16 2011 -0700 +++ b/vcweb/lighterprints/models.py Tue Aug 30 15:02:26 2011 -0700 @@ -90,6 +90,7 @@ return ActivityAvailability.objects.select_related(depth=1).filter(Q(**available_time_slot) | Q(**available_all_day)) def is_activity_available(activity, participant_group_relationship, **kwargs): + # FIXME: make sure that the activity level is appropriate for this PGR # how often can a participant participate in an activity? # whenever it falls within the ActivityAvailability schedule and if the participant # hasn't already performed this activity during this cycle. --- a/vcweb/lighterprints/views.py Mon Aug 22 16:24:16 2011 -0700 +++ b/vcweb/lighterprints/views.py Tue Aug 30 15:02:26 2011 -0700 @@ -129,7 +129,7 @@ return HttpResponseBadRequest(dumps({'response': "Could not perform activity"}), content_type='text/javascript') -def get_group_activity_json(participant_group_relationship, number_of_activities=5): +def get_group_activity_json(participant_group_relationship, number_of_activities=5, retrieve_all=True): group = participant_group_relationship.group chat_messages = [] for chat_message in ChatMessage.objects.filter(participant_group_relationship__group=group).order_by('-date_created'): @@ -140,6 +140,8 @@ }) group_activity = [] performed_activities = ParticipantRoundDataValue.objects.filter(participant_group_relationship__group=group, submitted=True, parameter=get_activity_performed_parameter()).order_by('-date_created') + if retrieve_all: + number_of_activities = len(performed_activities) for activity_prdv in performed_activities[:number_of_activities]: # FIXME: change this to activity name if we decide to use names instead of # pks http://bitbucket.org/virtualcommons/vcweb/changeset/187bc2b10ffb/ changeset: 187bc2b10ffb user: alllee date: 2011-08-31 00:04:02 summary: urk, forgot to fetch/merge before committing affected #: 2 files (172 bytes) --- a/vcweb/lighterprints/models.py Tue Aug 30 15:00:20 2011 -0700 +++ b/vcweb/lighterprints/models.py Tue Aug 30 15:04:02 2011 -0700 @@ -90,6 +90,7 @@ return ActivityAvailability.objects.select_related(depth=1).filter(Q(**available_time_slot) | Q(**available_all_day)) def is_activity_available(activity, participant_group_relationship, **kwargs): + # FIXME: make sure that the activity level is appropriate for this PGR # how often can a participant participate in an activity? # whenever it falls within the ActivityAvailability schedule and if the participant # hasn't already performed this activity during this cycle. --- a/vcweb/lighterprints/views.py Tue Aug 30 15:00:20 2011 -0700 +++ b/vcweb/lighterprints/views.py Tue Aug 30 15:04:02 2011 -0700 @@ -129,7 +129,7 @@ return HttpResponseBadRequest(dumps({'response': "Could not perform activity"}), content_type='text/javascript') -def get_group_activity_json(participant_group_relationship, number_of_activities=5): +def get_group_activity_json(participant_group_relationship, number_of_activities=5, retrieve_all=True): group = participant_group_relationship.group chat_messages = [] for chat_message in ChatMessage.objects.filter(participant_group_relationship__group=group).order_by('-date_created'): @@ -140,6 +140,8 @@ }) group_activity = [] performed_activities = ParticipantRoundDataValue.objects.filter(participant_group_relationship__group=group, submitted=True, parameter=get_activity_performed_parameter()).order_by('-date_created') + if retrieve_all: + number_of_activities = len(performed_activities) for activity_prdv in performed_activities[:number_of_activities]: # FIXME: change this to activity name if we decide to use names instead of # pks 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. |