Project

General

Profile

Download (913 Bytes) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / api.py @ 76974b6f

1

    
2
from tastypie.authorization import DjangoAuthorization
3
from tastypie.resources import ModelResource
4
from calebasse.agenda.models import Event
5
from calebasse.dossiers.models import PatientRecord, PatientAddress
6

    
7

    
8
class EventResource(ModelResource):
9
    class Meta:
10
        queryset = Event.objects.all()
11
        resource_name = 'event'
12
        authorization = DjangoAuthorization()
13

    
14
class PatientRecordRessource(ModelResource):
15
    class Meta:
16
        queryset = PatientRecord.objects.all()
17
        resource_name = 'patientrecord'
18
        authorization = DjangoAuthorization()
19

    
20
class PatientAddressRessource(ModelResource):
21
    class Meta:
22
        queryset = PatientAddress.objects.all()
23
        resource_name = 'patientaddress'
24
        authorization = DjangoAuthorization()
25

    
26
patientaddress_ressource = PatientAddressRessource()
27
event_resource = EventResource()
28
patientrecord_resource = PatientRecordRessource()
29

    
(2-2/13)