Project

General

Profile

« Previous | Next » 

Revision e5d0f8c5

Added by Jérôme Schneider over 13 years ago

agenda: fix appointments order and free time begin hour

View differences:

calebasse/agenda/appointments.py
self.event_id = None
self.service = None
self.workers_initial = None
self.weight = 0
self.act_type = None
self.__set_time(begin_time)
......
delta_minutes = delta.seconds / 60
appointment = Appointment()
appointment.init_free_time(delta_minutes,
time(free_time.lower_bound.hour, free_time.upper_bound.minute))
time(free_time.lower_bound.hour, free_time.lower_bound.minute))
appointments.append(appointment)
for occurrence in occurrences:
appointment = Appointment()
......
appointment = Appointment()
appointment.init_start_stop(u"Arrivée",
time(time_table.start_time.hour, time_table.start_time.minute))
appointment.weight = -1
appointments.append(appointment)
appointment = Appointment()
appointment.init_start_stop(u"Départ",
time(time_table.end_time.hour, time_table.end_time.minute))
appointment.weight = 1
appointments.append(appointment)
appointments = sorted(appointments, key=lambda app: app.begin_time)
return appointments
s = sorted(appointments, key=lambda app: app.weight)
return sorted(s, key=lambda app: app.begin_time)

Also available in: Unified diff