Exemplo n.º 1
0
    def get_full_day_meetings(self):
        """ Retrieve all the full day meetings of this week. """
        self.full_day_meetings = Meeting.get_by_date(
            self.session, self.calendar, self.start_date, self.stop_date, full_day=True
        )

        for meeting in Meeting.get_active_regular_meeting(
            self.session, self.calendar, self.start_date, self.stop_date, full_day=True
        ):
            for delta in range(0, 7):
                day = self.start_date + timedelta(days=delta)
                if ((meeting.meeting_date - day).days % meeting.recursion_frequency) == 0:
                    if meeting not in self.full_day_meetings:
                        self.full_day_meetings.append(meeting)
Exemplo n.º 2
0
    def get_meetings(self):
        """ Retrieves the list of this week meeting from the database.
        """
        self.meetings = Meeting.get_by_date(self.session, self.calendar, self.start_date, self.stop_date)

        self.meetings.extend(
            Meeting.get_by_date(self.session, self.calendar, self.start_date, self.stop_date, full_day=True)
        )

        for meeting in Meeting.get_active_regular_meeting(self.session, self.calendar, self.start_date, self.stop_date):
            for delta in range(0, 7):
                day = self.start_date + timedelta(days=delta)
                if ((meeting.meeting_date - day).days % meeting.recursion_frequency) == 0:
                    if meeting not in self.meetings:
                        self.meetings.append(meeting)
Exemplo n.º 3
0
    def get_meetings(self):
        """ Retrieves the list of this week's meeting from the database.
        """
        self.meetings = Meeting.get_by_date(
            self.session, self.calendar, self.start_date, self.stop_date)

        for meeting in Meeting.get_active_regular_meeting(
                self.session, self.calendar,
                self.start_date, self.stop_date):
            for delta in range(0, 7):
                day = self.start_date + timedelta(days=delta)
                if ((meeting.meeting_date - day).days %
                        meeting.recursion_frequency) == 0:
                    if meeting not in self.meetings:
                        self.meetings.append(meeting)
        # Expand the regular meetings so that they appear as meeting
        self.meetings = Meeting.expand_regular_meetings(
            self.meetings, end_date=self.stop_date,
            start_date=self.start_date)
        # Sort the meetings by date, time_start and name
        self.meetings.sort(key=operator.attrgetter(
            'meeting_date', 'meeting_time_start', 'meeting_name'))