Projet

Général

Profil

0001-departures-displayed-before-arrivals-in-timetables.patch

Serghei Mihai, 15 septembre 2014 17:18

Télécharger (1,83 ko)

Voir les différences:

Subject: [PATCH 1/2] departures displayed before arrivals in timetables

Closes #5465
 calebasse/agenda/appointments.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
calebasse/agenda/appointments.py
191 191
            appointment.type = 'busy-elsewhere'
192 192
        appointment.other_services_names = [s.slug for s in services if s != service]
193 193
        appointments.append(appointment)
194
    print "time tables: %s" % time_tables
194 195
    for time_table in time_tables:
195 196
        interval_set = IntervalSet.between(time_table.to_interval(date).lower_bound.time(),
196 197
                                   time_table.to_interval(date).upper_bound.time())
......
214 215
        appointment.other_services_names = services
215 216
        appointment.init_start_stop(u"Arrivée", start_time, appointment_type)
216 217
        activity['arrival'] = start_time
217
        appointment.weight = -1
218
        appointment.weight = 1
218 219
        appointments.append(appointment)
219 220
        appointment = Appointment()
220 221
        appointment.init_start_stop(u"Départ", end_time, appointment_type)
221 222
        appointment.other_services_names = services
222 223
        activity['departure'] = end_time
223
        appointment.weight = 1
224
        appointment.weight = -1
224 225
        appointments.append(appointment)
225 226

  
226 227
    return activity, sorted(appointments, key=lambda app: (app.begin_time, app.weight, app.event_id))
227
-