forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresources.py
More file actions
64 lines (55 loc) · 1.95 KB
/
resources.py
File metadata and controls
64 lines (55 loc) · 1.95 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Copyright The IETF Trust 2016-2019, All Rights Reserved
# -*- coding: utf-8 -*-
# Autogenerated by the makeresources management command 2016-06-12 12:29 PDT
from ietf.api import ModelResource
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.api import ToOneField # pyflakes:ignore
from ietf.mailinglists.models import Allowlisted, List, Subscribed
from ietf.person.resources import PersonResource
class AllowlistedResource(ModelResource):
by = ToOneField(PersonResource, 'by')
class Meta:
queryset = Allowlisted.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'allowlisted'
ordering = ['id', ]
filtering = {
"id": ALL,
"time": ALL,
"email": ALL,
"by": ALL_WITH_RELATIONS,
}
api.mailinglists.register(AllowlistedResource())
class ListResource(ModelResource):
class Meta:
queryset = List.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'list'
ordering = ['id', ]
filtering = {
"id": ALL,
"name": ALL,
"description": ALL,
"advertised": ALL,
}
api.mailinglists.register(ListResource())
class SubscribedResource(ModelResource):
lists = ToManyField(ListResource, 'lists', null=True)
class Meta:
queryset = Subscribed.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'subscribed'
ordering = ['id', ]
filtering = {
"id": ALL,
"time": ALL,
"email": ALL,
"lists": ALL_WITH_RELATIONS,
}
api.mailinglists.register(SubscribedResource())