calebasse / calebasse / api.py @ 26c60057
1 |
|
---|---|
2 |
from tastypie.authorization import DjangoAuthorization |
3 |
from tastypie.resources import ModelResource |
4 |
from calebasse.agenda.models import Event, Occurrence |
5 |
|
6 |
|
7 |
class EventResource(ModelResource): |
8 |
class Meta: |
9 |
queryset = Event.objects.all() |
10 |
resource_name = 'event' |
11 |
authorization = DjangoAuthorization() |
12 |
|
13 |
class OccurrenceResource(ModelResource): |
14 |
class Meta: |
15 |
queryset = Occurrence.objects.all() |
16 |
resource_name = 'occurrence' |
17 |
authorization = DjangoAuthorization() |