forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresources.py
More file actions
84 lines (75 loc) · 2.81 KB
/
resources.py
File metadata and controls
84 lines (75 loc) · 2.81 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright The IETF Trust 2017-2019, All Rights Reserved
# -*- coding: utf-8 -*-
# Autogenerated by the makeresources management command 2017-02-15 10:10 PST
from tastypie.resources 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.stats.models import CountryAlias, AffiliationIgnoredEnding, AffiliationAlias, MeetingRegistration
from ietf.name.resources import CountryNameResource
class CountryAliasResource(ModelResource):
country = ToOneField(CountryNameResource, 'country')
class Meta:
queryset = CountryAlias.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'countryalias'
ordering = ['id', ]
filtering = {
"id": ALL,
"alias": ALL,
"country": ALL_WITH_RELATIONS,
}
api.stats.register(CountryAliasResource())
class AffiliationIgnoredEndingResource(ModelResource):
class Meta:
queryset = AffiliationIgnoredEnding.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'affiliationignoredending'
ordering = ['id', ]
filtering = {
"id": ALL,
"ending": ALL,
}
api.stats.register(AffiliationIgnoredEndingResource())
class AffiliationAliasResource(ModelResource):
class Meta:
queryset = AffiliationAlias.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'affiliationalias'
ordering = ['id', ]
filtering = {
"id": ALL,
"alias": ALL,
"name": ALL,
}
api.stats.register(AffiliationAliasResource())
from ietf.meeting.resources import MeetingResource
from ietf.person.resources import PersonResource
class MeetingRegistrationResource(ModelResource):
meeting = ToOneField(MeetingResource, 'meeting')
person = ToOneField(PersonResource, 'person', null=True)
class Meta:
queryset = MeetingRegistration.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'meetingregistration'
ordering = ['id', ]
filtering = {
"id": ALL,
"first_name": ALL,
"last_name": ALL,
"affiliation": ALL,
"country_code": ALL,
"email": ALL,
"reg_type": ALL,
"ticket_type": ALL,
"attended": ALL,
"meeting": ALL_WITH_RELATIONS,
"person": ALL_WITH_RELATIONS,
}
api.stats.register(MeetingRegistrationResource())