Revision 538aedd7
Added by Jérôme Schneider over 12 years ago
calebasse/agenda/views.py | ||
---|---|---|
1 |
import ipdb |
|
2 | 1 |
import datetime |
3 | 2 |
|
4 | 3 |
from django.shortcuts import redirect |
... | ... | |
20 | 19 |
def get_context_data(self, **kwargs): |
21 | 20 |
context = super(AgendaHomepageView, self).get_context_data(**kwargs) |
22 | 21 |
context['workers_types'] = [] |
23 |
context['workers'] = [] |
|
22 |
context['workers_agenda'] = []
|
|
24 | 23 |
context['disponnibility'] = {} |
24 |
workers = [] |
|
25 | 25 |
for worker_type in WorkerType.objects.all(): |
26 | 26 |
data = {'type': worker_type.name, 'workers': Worker.objects.for_service(self.service, worker_type) } |
27 | 27 |
context['workers_types'].append(data) |
28 |
context['workers'].extend(Worker.objects.for_service(self.service, worker_type)) |
|
28 |
workers.extend(data['workers']) |
|
29 |
|
|
30 |
for worker in workers: |
|
31 |
context['workers_agenda'].append({'worker': worker, |
|
32 |
'agenda': Occurrence.objects.daily_occurrences(context['date'], [worker])}) |
|
29 | 33 |
|
30 | 34 |
context['disponnibility'] = Occurrence.objects.daily_disponiblity(context['date'], context['workers']) |
31 | 35 |
return context |
Also available in: Unified diff
Agenda tempaltes: begin appointments integration