示例#1
0
 def getChoiceData(self, **kwargs):
     choice_data = dict()
     choice_data['event_type'] = Choices().getEventTypeChoices()
     choice_data['event_status'] = Choices().getEventStatusChoices()
     choice_data['event_host'] = Choices().getSchoolChoices()
     choice_data['event_season'] = Choices().getSeasonChoices()
     choice_data['event_region'] = Choices().getRegionChoices()
     choice_data['event_type'] = tuple([
         (lambda event_type:
          (event_type.id, event_type.event_type_name))(EventTypeAPI(
              self.request).getSelf(event_type_name=EventType.FLEET_RACE))
     ])
     return choice_data
    def generateList(self):
        event_type = dict(
            (y, x)
            for x, y in Choices().getEventTypeChoices())[self.param["type"]]

        def genDict(status):
            events = event_api.filterSelf(event_status=status,
                                          event_type=event_type)
            event_dict = map(
                lambda event: dict(
                    element_text=event.event_name,
                    element_link=reverse(
                        'panel.module.management_event.view_dispatch_param',
                        args=['activity', event.id]),
                    elements=[
                        dict(
                            text='Teams',
                            link=reverse(
                                'panel.module.management_event.view_dispatch_param',
                                args=['team', event.id])),
                        dict(text='Races (WIP)', link='#'),
                        dict(text='Manage',
                             link=event_api.getEventModifyLink(
                                 self.param["type"], id=event.id))
                    ]), [event for event in events])
            return BlockObject(status, 'Event', ['', '', ''], event_dict)

        event_api = EventAPI(self.request)
        return BlockSet().makeBlockSet(genDict('future'), genDict('running'),
                                       genDict('done'))
示例#3
0
 def getChoiceData(self):
     choice_data = dict()
     choice_data['event_type'] = Choices().getEventTypeChoices()
     choice_data['event_class'] = Choices().getEventClassChoices()
     choice_data['event_status'] = Choices().getEventStatusChoices()
     choice_data['event_host'] = Choices().getSchoolChoices()
     choice_data['event_season'] = Choices().getSeasonChoices()
     choice_data['event_region'] = Choices().getRegionChoices()
     return choice_data
示例#4
0
 def __init__(self, request):
     self.base_class = Event
     self.validation_table = {
         'base_table_invalid': {
             '_state', 'id', 'event_rotation_detail', 'event_school_ids',
             'event_create_time'
         },
         'base_form_invalid': {
             '_state', 'id', 'event_team_number', 'event_school_ids',
             'event_rotation_detail', 'event_create_time'
         },
     }
     super().__init__(request, self.base_class, self.validation_table)
     self.form_path = self.setFormPath()
     self.event_types = {
         type_name: type_id
         for type_id, type_name in Choices().getEventTypeChoices()
     }
示例#5
0
 def getMultiChoiceData(self):
     multi_choice_data = dict()
     multi_choice_data['event_team'] = Choices().getSchoolChoices()
     return multi_choice_data
 def getChoiceData(self):
     choice_data = dict()
     choice_data["member_group_school"] = Choices().getSchoolChoices()
     return choice_data
示例#7
0
 def getChoiceData(self):
     choice_data = dict()
     choice_data["account_status"] = Choices().getStatusChoices()
     choice_data["account_type"] = Choices().getAccountTypeChocies()
     return choice_data
示例#8
0
 def getChoiceData(self):
     choice_data = dict()
     choice_data["team_status"] = Choices().getTeamStatusChoices()
     choice_data["team_school"] = Choices().getSchoolChoices()
     return choice_data
示例#9
0
 def getChoiceData(self):
     choice_data = dict()
     choice_data['event_activity_type'] = Choices().getEventActivityTypeChoices()
     choice_data['event_activity_status'] = Choices().getEventStatusChoices()
     return choice_data
示例#10
0
 def getChoiceData(self):
     choice_data = dict()
     choice_data["school_region"] = Choices().getRegionChoices()
     choice_data["school_status"] = Choices().getStatusChoices()
     return choice_data
 def getChoiceData(self):
     choice_data = dict()
     choice_data['summary_event_school'] = Choices().getSchoolChoices()
     return choice_data
示例#12
0
 def getChoiceData(self):
     choice_data = dict()
     choice_data["member_status"] = Choices().getStatusChoices()
     choice_data["member_school"] = Choices().getSchoolChoices()
     return choice_data