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
247 lines (229 loc) · 8.81 KB
/
resources.py
File metadata and controls
247 lines (229 loc) · 8.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# 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 ietf.api import ToOneField
from tastypie.fields import ToManyField
from tastypie.constants import ALL, ALL_WITH_RELATIONS
from tastypie.cache import SimpleCache
from ietf import api
from ietf.nomcom.models import (NomCom, Position, Nominee, ReminderDates, NomineePosition,
Feedback, Nomination, FeedbackLastSeen, Topic, TopicFeedbackLastSeen, Volunteer, )
from ietf.group.resources import GroupResource
class NomComResource(ModelResource):
group = ToOneField(GroupResource, 'group')
class Meta:
cache = SimpleCache()
queryset = NomCom.objects.all()
serializer = api.Serializer()
#resource_name = 'nomcom'
ordering = ['id', ]
filtering = {
"id": ALL,
"public_key": ALL,
"send_questionnaire": ALL,
"reminder_interval": ALL,
"initial_text": ALL,
"show_nominee_pictures": ALL,
"show_accepted_nominees": ALL,
"group": ALL_WITH_RELATIONS,
}
api.nomcom.register(NomComResource())
from ietf.dbtemplate.resources import DBTemplateResource
class PositionResource(ModelResource):
nomcom = ToOneField(NomComResource, 'nomcom')
requirement = ToOneField(DBTemplateResource, 'requirement', null=True)
questionnaire = ToOneField(DBTemplateResource, 'questionnaire', null=True)
class Meta:
cache = SimpleCache()
queryset = Position.objects.all()
serializer = api.Serializer()
#resource_name = 'position'
ordering = ['id', ]
filtering = {
"id": ALL,
"name": ALL,
"is_open": ALL,
"accepting_nominations": ALL,
"accepting_feedback": ALL,
"nomcom": ALL_WITH_RELATIONS,
"requirement": ALL_WITH_RELATIONS,
"questionnaire": ALL_WITH_RELATIONS,
}
api.nomcom.register(PositionResource())
from ietf.person.resources import EmailResource
class NomineeResource(ModelResource):
email = ToOneField(EmailResource, 'email')
duplicated = ToOneField('ietf.nomcom.resources.NomineeResource', 'duplicated', null=True)
nomcom = ToOneField(NomComResource, 'nomcom')
nominee_position = ToManyField(PositionResource, 'nominee_position', null=True)
class Meta:
cache = SimpleCache()
queryset = Nominee.objects.all()
serializer = api.Serializer()
#resource_name = 'nominee'
ordering = ['id', ]
filtering = {
"id": ALL,
"email": ALL_WITH_RELATIONS,
"duplicated": ALL_WITH_RELATIONS,
"nomcom": ALL_WITH_RELATIONS,
"nominee_position": ALL_WITH_RELATIONS,
}
api.nomcom.register(NomineeResource())
class ReminderDatesResource(ModelResource):
nomcom = ToOneField(NomComResource, 'nomcom')
class Meta:
cache = SimpleCache()
queryset = ReminderDates.objects.all()
serializer = api.Serializer()
#resource_name = 'reminderdates'
ordering = ['id', ]
filtering = {
"id": ALL,
"date": ALL,
"nomcom": ALL_WITH_RELATIONS,
}
api.nomcom.register(ReminderDatesResource())
from ietf.name.resources import NomineePositionStateNameResource
class NomineePositionResource(ModelResource):
position = ToOneField(PositionResource, 'position')
nominee = ToOneField(NomineeResource, 'nominee')
state = ToOneField(NomineePositionStateNameResource, 'state')
class Meta:
cache = SimpleCache()
queryset = NomineePosition.objects.all()
serializer = api.Serializer()
#resource_name = 'nomineeposition'
ordering = ['id', ]
filtering = {
"id": ALL,
"time": ALL,
"position": ALL_WITH_RELATIONS,
"nominee": ALL_WITH_RELATIONS,
"state": ALL_WITH_RELATIONS,
}
api.nomcom.register(NomineePositionResource())
from ietf.name.resources import FeedbackTypeNameResource
from ietf.utils.resources import UserResource
class FeedbackResource(ModelResource):
nomcom = ToOneField(NomComResource, 'nomcom')
type = ToOneField(FeedbackTypeNameResource, 'type', null=True)
user = ToOneField(UserResource, 'user', null=True)
positions = ToManyField(PositionResource, 'positions', null=True)
nominees = ToManyField(NomineeResource, 'nominees', null=True)
class Meta:
cache = SimpleCache()
queryset = Feedback.objects.all()
serializer = api.Serializer()
#resource_name = 'feedback'
ordering = ['id', ]
filtering = {
"id": ALL,
"author": ALL,
"subject": ALL,
# "comments": ALL,
"time": ALL,
"nomcom": ALL_WITH_RELATIONS,
"type": ALL_WITH_RELATIONS,
"user": ALL_WITH_RELATIONS,
"positions": ALL_WITH_RELATIONS,
"nominees": ALL_WITH_RELATIONS,
}
api.nomcom.register(FeedbackResource())
from ietf.utils.resources import UserResource
class NominationResource(ModelResource):
position = ToOneField(PositionResource, 'position')
nominee = ToOneField(NomineeResource, 'nominee')
comments = ToOneField(FeedbackResource, 'comments')
user = ToOneField(UserResource, 'user', null=True)
class Meta:
cache = SimpleCache()
queryset = Nomination.objects.all()
serializer = api.Serializer()
#resource_name = 'nomination'
ordering = ['id', ]
filtering = {
"id": ALL,
"candidate_name": ALL,
"candidate_email": ALL,
"candidate_phone": ALL,
"nominator_email": ALL,
"time": ALL,
"position": ALL_WITH_RELATIONS,
"nominee": ALL_WITH_RELATIONS,
"comments": ALL_WITH_RELATIONS,
"user": ALL_WITH_RELATIONS,
}
api.nomcom.register(NominationResource())
from ietf.person.resources import PersonResource
class FeedbackLastSeenResource(ModelResource):
reviewer = ToOneField(PersonResource, 'reviewer')
nominee = ToOneField(NomineeResource, 'nominee')
class Meta:
cache = SimpleCache()
queryset = FeedbackLastSeen.objects.all()
serializer = api.Serializer()
ordering = ['id', ]
filtering = {
"id": ALL,
"time": ALL,
"reviewer": ALL_WITH_RELATIONS,
"nominee": ALL_WITH_RELATIONS,
}
api.nomcom.register(FeedbackLastSeenResource())
from ietf.name.resources import TopicAudienceNameResource
from ietf.dbtemplate.resources import DBTemplateResource
class TopicResource(ModelResource):
nomcom = ToOneField(NomComResource, 'nomcom')
description = ToOneField(DBTemplateResource, 'description', null=True)
audience = ToOneField(TopicAudienceNameResource, 'audience')
class Meta:
queryset = Topic.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'topic'
ordering = ['id', ]
filtering = {
"id": ALL,
"subject": ALL,
"accepting_feedback": ALL,
"nomcom": ALL_WITH_RELATIONS,
"description": ALL_WITH_RELATIONS,
"audience": ALL_WITH_RELATIONS,
}
api.nomcom.register(TopicResource())
from ietf.person.resources import PersonResource
class TopicFeedbackLastSeenResource(ModelResource):
reviewer = ToOneField(PersonResource, 'reviewer')
topic = ToOneField(TopicResource, 'topic')
class Meta:
queryset = TopicFeedbackLastSeen.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'topicfeedbacklastseen'
ordering = ['id', ]
filtering = {
"id": ALL,
"time": ALL,
"reviewer": ALL_WITH_RELATIONS,
"topic": ALL_WITH_RELATIONS,
}
api.nomcom.register(TopicFeedbackLastSeenResource())
from ietf.person.resources import PersonResource
class VolunteerResource(ModelResource):
nomcom = ToOneField(NomComResource, 'nomcom')
person = ToOneField(PersonResource, 'person')
class Meta:
queryset = Volunteer.objects.all()
serializer = api.Serializer()
cache = SimpleCache()
#resource_name = 'volunteer'
ordering = ['id', ]
filtering = {
"id": ALL,
"affiliation": ALL,
"nomcom": ALL_WITH_RELATIONS,
"person": ALL_WITH_RELATIONS,
}
api.nomcom.register(VolunteerResource())