forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresources.py
More file actions
39 lines (33 loc) · 1.23 KB
/
resources.py
File metadata and controls
39 lines (33 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Autogenerated by the makeresources management command 2015-08-06 11:00 PDT
from ietf.api import ModelResource
from ietf.api import ToOneField # pyflakes:ignore
from tastypie.fields import ToManyField # pyflakes:ignore
from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore
from tastypie.cache import SimpleCache
from ietf import api
from ietf.mailtrigger.models import Recipient, MailTrigger
class RecipientResource(ModelResource):
class Meta:
cache = SimpleCache()
queryset = Recipient.objects.all()
#resource_name = 'recipient'
filtering = {
"slug": ALL,
"desc": ALL,
"template": ALL,
}
api.mailtrigger.register(RecipientResource())
class MailTriggerResource(ModelResource):
to = ToManyField(RecipientResource, 'to', null=True)
cc = ToManyField(RecipientResource, 'cc', null=True)
class Meta:
cache = SimpleCache()
queryset = MailTrigger.objects.all()
#resource_name = 'mailtrigger'
filtering = {
"slug": ALL,
"desc": ALL,
"to": ALL_WITH_RELATIONS,
"cc": ALL_WITH_RELATIONS,
}
api.mailtrigger.register(MailTriggerResource())