Revision 0f0cacbb
Added by Jérôme Schneider over 12 years ago
calebasse/agenda/views.py | ||
---|---|---|
1 |
import ipdb |
|
1 | 2 |
import datetime |
2 | 3 |
|
3 | 4 |
from django.shortcuts import redirect |
4 | 5 |
|
5 | 6 |
from calebasse.cbv import TemplateView |
6 | 7 |
from calebasse.personnes.models import Worker |
8 |
from calebasse.ressources.models import WorkerType |
|
7 | 9 |
|
8 | 10 |
def redirect_today(request, service): |
9 | 11 |
'''If not date is given we redirect on the agenda for today''' |
... | ... | |
11 | 13 |
service=service) |
12 | 14 |
|
13 | 15 |
class AgendaHomepageView(TemplateView): |
16 |
|
|
14 | 17 |
template_name = 'agenda/index.html' |
15 | 18 |
|
16 | 19 |
def get_context_data(self, **kwargs): |
17 | 20 |
context = super(AgendaHomepageView, self).get_context_data(**kwargs) |
18 |
#context['therapeutes'] = Therapeute.objects.for_service(self.service) |
|
19 |
#context['personnels'] = Personnel.objects.for_service(self.service) |
|
21 |
context['workers_types'] = [] |
|
22 |
for worker_type in WorkerType.objects.all(): |
|
23 |
data = {'type': worker_type.name, 'workers': Worker.objects.for_service(self.service, worker_type) } |
|
24 |
context['workers_types'].append(data) |
|
20 | 25 |
return context |
Also available in: Unified diff
Agenda: begin graphic integration