family_camp/schedule/deep.py
def export_map(self):
        """Returns a row for each interval. A column for each activity.
        Each cell is the percentage of the slots for that activity/session
        that are used by the timetable."""
        acts = set([s.activity for s in self.sessions])
        # For each 15 period from the start to the end of each day.

        # Get list of days
        days = set([s.start.day for s in self.sessions])

        header = ['Time']
        header.extend([act.name for act in acts])

        out = [header, ]
        for day in days:
            # Get first and last time.
            start = sorted([s.start for s in self.sessions
                            if s.start.day == day])[0]
            end = sorted([s.start for s in self.sessions
                          if s.start.day == day])[-1]

            t = start
            while t < end:
                row = [t.strftime(DATEFORMAT), ]
                for a in acts:
                    active_session = [s for s in self.session_inst
                                      if s.session.activity == a and
                                      (s.session.start <= t and
                                       s.session.end > t)]
                    row.append(
                        str(len(active_session[0].campers) /
                            active_session[0].session.activity.limit)
                        if active_session else '')
                out.append(row)
                t = t + timedelta(minutes=15)

        return out
Returns a row for each interval. A column for each activity.
        Each cell is the percentage of the slots for that activity/session
        that are used by the timetable.
Returns a row for each interval. A column for each activity.
Each cell is the percentage of the slots for that activity/session
that are used by the timetable.
Returns a row for each interval . A column for each activity . Each cell is the percentage of the slots for that activity / session that are used by the timetable .
def export_map(self):
        acts = set([s.activity for s in self.sessions])
        days = set([s.start.day for s in self.sessions])
        header = ['Time']
        header.extend([act.name for act in acts])
        out = [header, ]
        for day in days:
            start = sorted([s.start for s in self.sessions
                            if s.start.day == day])[0]
            end = sorted([s.start for s in self.sessions
                          if s.start.day == day])[-1]
            t = start
            while t < end:
                row = [t.strftime(DATEFORMAT), ]
                for a in acts:
                    active_session = [s for s in self.session_inst
                                      if s.session.activity == a and
                                      (s.session.start <= t and
                                       s.session.end > t)]
                    row.append(
                        str(len(active_session[0].campers) /
                            active_session[0].session.activity.limit)
                        if active_session else '')
                out.append(row)
                t = t + timedelta(minutes=15)
        return out
def export_map ( self ) : acts = set ( [ s . activity for s in self . sessions ] ) days = set ( [ s . start . day for s in self . sessions ] ) header = [ 'Time' ] header . extend ( [ act . name for act in acts ] ) out = [ header , ] for day in days : start = sorted ( [ s . start for s in self . sessions if s . start . day == day ] ) [ 0 ] end = sorted ( [ s . start for s in self . sessions if s . start . day == day ] ) [ - 1 ] t = start while t < end : row = [ t . strftime ( DATEFORMAT ) , ] for a in acts : active_session = [ s for s in self . session_inst if s . session . activity == a and ( s . session . start <= t and s . session . end > t ) ] row . append ( str ( len ( active_session [ 0 ] . campers ) / active_session [ 0 ] . session . activity . limit ) if active_session else '' ) out . append ( row ) t = t + timedelta ( minutes = 15 ) return out
Returns a row for each interval.
Returns a row for each interval .
"""Returns a row for each interval. A column for each activity.
        Each cell is the percentage of the slots for that activity/session
        that are used by the timetable.""" # For each 15 period from the start to the end of each day. # Get list of days # Get first and last time.
self