forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathresources.py
More file actions
37 lines (30 loc) · 1.14 KB
/
resources.py
File metadata and controls
37 lines (30 loc) · 1.14 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
# Copyright The IETF Trust 2014-2019, All Rights Reserved
# -*- coding: utf-8 -*-
# Autogenerated by the mkresources management command 2014-11-13 23:53
from ietf.api import ModelResource
from tastypie.fields import ToOneField
from tastypie.constants import ALL, ALL_WITH_RELATIONS
from tastypie.cache import SimpleCache
from ietf import api
from ietf.dbtemplate.models import DBTemplate
from ietf.group.resources import GroupResource
from ietf.name.resources import DBTemplateTypeNameResource
class DBTemplateResource(ModelResource):
type = ToOneField(DBTemplateTypeNameResource, 'type')
group = ToOneField(GroupResource, 'group', null=True)
class Meta:
cache = SimpleCache()
queryset = DBTemplate.objects.all()
serializer = api.Serializer()
#resource_name = 'dbtemplate'
ordering = ['id', ]
filtering = {
"id": ALL,
"path": ALL,
"title": ALL,
"variables": ALL,
"content": ALL,
"type": ALL_WITH_RELATIONS,
"group": ALL_WITH_RELATIONS,
}
api.dbtemplate.register(DBTemplateResource())