Ejemplo n.º 1
0
    def _post_process_for_output(self, model, output):
        """
        Add some extra stuff for the videographer's use.
        Legend:
            / Have already
            - Can get, somehow
            X Not there at all

        fields that Carl wants:
        / name - title of talk
        / room - "room1" if there is only one room.
        / start - datetime in some parsable format
        / duration -- int minutes or "hh:mm:ss"
        / end - datetime in some parsable format
        - authors - list of people's names.
        - contact - list of email(s) of presenters.
        X released - permission to release.
        X license - CC license
        / description - used as the description of the video
          (paragraphs are fine)
        / conf_key - PK in source database - unique, used to update this item
        / conf_url - URL of talk page
        X tags - comma separated list - search terms, including sub topics
          briefly discussed in your talk.
        """
        request = get_current_request()
        new_output = output.copy()
        new_output.update({
            # Extra fields for Carl
            'name':
            output['title'],
            'description':
            output['abstract'],
            'conf_key':
            output['id'],
            'conf_url':
            route_url('talk_get', request, id=output['id']),
        })
        schedule = {
            'schedule_slot_id': None,
            'room': None,
            'start': None,
            'end': None,
            'duration': None,
        }
        if model.schedule_slot:
            assert model.schedule_slot.start < model.schedule_slot.end
            end = model.schedule_slot.end
            start = model.schedule_slot.start
            duration_delta = end - start
            assert duration_delta.days == 0
            schedule.update({
                'schedule_slot_id': model.schedule_slot.id,
                'room': model.schedule_slot.room,
                'start': local_isoformat(model.schedule_slot.start),
                'end': local_isoformat(model.schedule_slot.end),
                'duration': duration_delta.seconds / 60,
            })
        new_output.update(schedule)
        return new_output
Ejemplo n.º 2
0
    def _post_process_for_output(self, model, output):
        """
        Add some extra stuff for the videographer's use.
        Legend:
            / Have already
            - Can get, somehow
            X Not there at all

        fields that Carl wants:
        / name - title of talk
        / room - "room1" if there is only one room.
        / start - datetime in some parsable format
        / duration -- int minutes or "hh:mm:ss"
        / end - datetime in some parsable format
        - authors - list of people's names.
        - contact - list of email(s) of presenters.
        X released - permission to release.
        X license - CC license
        / description - used as the description of the video
          (paragraphs are fine)
        / conf_key - PK in source database - unique, used to update this item
        / conf_url - URL of talk page
        X tags - comma separated list - search terms, including sub topics
          briefly discussed in your talk.
        """
        request = get_current_request()
        new_output = output.copy()
        new_output.update({
            # Extra fields for Carl
            'name': output['title'],
            'description': output['abstract'],
            'conf_key': output['id'],
            'conf_url': route_url('talk_get', request, id=output['id']),
        })
        schedule = {
            'schedule_slot_id': None,
            'room': None,
            'start': None,
            'end': None,
            'duration': None,
            'schedule_code': None,
        }
        if model.schedule_slot:
            assert model.schedule_slot.start < model.schedule_slot.end
            end = model.schedule_slot.end
            start = model.schedule_slot.start
            duration_delta = end - start
            assert duration_delta.days == 0
            schedule.update({
                'schedule_slot_id': model.schedule_slot.id,
                'room': model.schedule_slot.room,
                'start': local_isoformat(model.schedule_slot.start),
                'end': local_isoformat(model.schedule_slot.end),
                'duration': duration_delta.seconds / 60,
                'schedule_code': model.schedule_slot.code,
            })
        new_output.update(schedule)
        return new_output
Ejemplo n.º 3
0
 def to_dict(self, is_admin):
     duration_delta = self.end - self.start
     data = {
         'id': self.id,
         'room': self.room,
         'start': local_isoformat(self.start),
         'end': local_isoformat(self.end),
         'duration': duration_delta.seconds / 60,
     }
     return data
Ejemplo n.º 4
0
 def to_dict(self, is_admin):
     duration_delta = self.end - self.start
     data = {
         'id': self.id,
         'room': self.room,
         'start': local_isoformat(self.start),
         'end': local_isoformat(self.end),
         'duration': duration_delta.seconds / 60,
     }
     return data