datatracker/ietf/liaisons/resources.py

51 lines
2 KiB
Python

# Autogenerated by the mkresources management command 2014-11-13 23:53
from tastypie.resources import ModelResource
from tastypie.fields import ToOneField, ToManyField
from tastypie.constants import ALL, ALL_WITH_RELATIONS
from ietf import api
from ietf.liaisons.models import * # pyflakes:ignore
from ietf.group.resources import GroupResource
from ietf.doc.resources import DocumentResource
from ietf.name.resources import LiaisonStatementPurposeNameResource
from ietf.person.resources import EmailResource
class LiaisonStatementResource(ModelResource):
purpose = ToOneField(LiaisonStatementPurposeNameResource, 'purpose')
related_to = ToOneField('ietf.liaisons.resources.LiaisonStatementResource', 'related_to', null=True)
from_group = ToOneField(GroupResource, 'from_group', null=True)
from_contact = ToOneField(EmailResource, 'from_contact', null=True)
to_group = ToOneField(GroupResource, 'to_group', null=True)
attachments = ToManyField(DocumentResource, 'attachments', null=True)
class Meta:
queryset = LiaisonStatement.objects.all()
serializer = api.Serializer()
#resource_name = 'liaisonstatement'
filtering = {
"id": ALL,
"title": ALL,
"body": ALL,
"deadline": ALL,
"from_name": ALL,
"to_name": ALL,
"to_contact": ALL,
"reply_to": ALL,
"response_contact": ALL,
"technical_contact": ALL,
"cc": ALL,
"submitted": ALL,
"modified": ALL,
"approved": ALL,
"action_taken": ALL,
"purpose": ALL_WITH_RELATIONS,
"related_to": ALL_WITH_RELATIONS,
"from_group": ALL_WITH_RELATIONS,
"from_contact": ALL_WITH_RELATIONS,
"to_group": ALL_WITH_RELATIONS,
"attachments": ALL_WITH_RELATIONS,
}
api.liaisons.register(LiaisonStatementResource())