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
50 lines (40 loc) · 1.5 KB
/
resources.py
File metadata and controls
50 lines (40 loc) · 1.5 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
# 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, NonWgMailingList
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 NonWgMailingListResource(ModelResource):
class Meta:
queryset = NonWgMailingList.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'nonwgmailinglist'
ordering = ['id', ]
filtering = {
"id": ALL,
"name": ALL,
"domain": ALL,
"description": ALL,
}
api.mailinglists.register(NonWgMailingListResource())