Beispiel #1
0
 def save(self, vr=None):
     if vr:
         ts = vr.timeslot
         ts.start = self.cleaned_data['start_time']
         ts.end = self.cleaned_data['end_time']
         ts.short_description = ts.description = self.cleaned_data[
             'description']
         ts.save()
         vr.num_volunteers = self.cleaned_data['num_volunteers']
         vr.program = self.program
         vr.save()
     else:
         ts = Event()
         ts.anchor = self.program.anchor
         ts.start = self.cleaned_data['start_time']
         ts.end = self.cleaned_data['end_time']
         ts.short_description = ts.description = self.cleaned_data[
             'description']
         ts.event_type, created = EventType.objects.get_or_create(
             description='Volunteer')
         ts.save()
         vr = VolunteerRequest()
         vr.program = self.program
         vr.timeslot = ts
         vr.num_volunteers = self.cleaned_data['num_volunteers']
         vr.save()
Beispiel #2
0
 def save(self, vr=None):
     if vr:
         ts = vr.timeslot
         ts.start = self.cleaned_data['start_time']
         ts.end = self.cleaned_data['end_time']
         ts.short_description = ts.description = self.cleaned_data[
             'description']
         ts.save()
         vr.num_volunteers = self.cleaned_data['num_volunteers']
         vr.program = self.program
         vr.save()
     else:
         ts = Event()
         ts.program = self.program
         ts.start = self.cleaned_data['start_time']
         ts.end = self.cleaned_data['end_time']
         ts.short_description = ts.description = self.cleaned_data[
             'description']
         ts.event_type = EventType.get_from_desc('Volunteer')
         ts.save()
         vr = VolunteerRequest()
         vr.program = self.program
         vr.timeslot = ts
         vr.num_volunteers = self.cleaned_data['num_volunteers']
         vr.save()
 def save(self, vr=None):
     if vr:
         ts = vr.timeslot
         ts.start = self.cleaned_data['start_time']
         ts.end = self.cleaned_data['end_time']
         ts.short_description = ts.description = self.cleaned_data['description']
         ts.save()
         vr.num_volunteers = self.cleaned_data['num_volunteers']
         vr.program = self.program
         vr.save()
     else:
         ts = Event()
         ts.program = self.program
         ts.start = self.cleaned_data['start_time']
         ts.end = self.cleaned_data['end_time']
         ts.short_description = ts.description = self.cleaned_data['description']
         ts.event_type = EventType.get_from_desc('Volunteer')
         ts.save()
         vr = VolunteerRequest()
         vr.program = self.program
         vr.timeslot = ts
         vr.num_volunteers = self.cleaned_data['num_volunteers']
         vr.save()