datatracker/ietf/mailtoken/resources.py
2015-08-09 20:11:26 +00:00

34 lines
1 KiB
Python

# Autogenerated by the makeresources management command 2015-08-06 11:00 PDT
from tastypie.resources import ModelResource
from tastypie.fields import ToOneField, ToManyField # pyflakes:ignore
from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore
from ietf import api
from ietf.mailtoken.models import * # pyflakes:ignore
class RecipientResource(ModelResource):
class Meta:
queryset = Recipient.objects.all()
#resource_name = 'recipient'
filtering = {
"slug": ALL,
"desc": ALL,
"template": ALL,
}
api.mailtoken.register(RecipientResource())
class MailTokenResource(ModelResource):
recipients = ToManyField(RecipientResource, 'recipients', null=True)
class Meta:
queryset = MailToken.objects.all()
#resource_name = 'mailtoken'
filtering = {
"slug": ALL,
"desc": ALL,
"recipients": ALL_WITH_RELATIONS,
}
api.mailtoken.register(MailTokenResource())