|
1 | | -# Autogenerated by the mkresources management command 2014-12-14 19:50 |
| 1 | +# Autogenerated by the makeresources management command 2015-10-19 12:29 PDT |
2 | 2 | from tastypie.resources import ModelResource |
3 | | -from tastypie.fields import ToOneField, ToManyField, CharField |
4 | | -from tastypie.constants import ALL, ALL_WITH_RELATIONS |
| 3 | +from tastypie.fields import ToOneField, ToManyField, CharField # pyflakes:ignore |
| 4 | +from tastypie.constants import ALL, ALL_WITH_RELATIONS # pyflakes:ignore |
5 | 5 |
|
6 | 6 | from ietf import api |
7 | 7 |
|
8 | | -from ietf.doc.models import * # pyflakes:ignore |
| 8 | +from ietf.doc.models import * # pyflakes:ignore |
9 | 9 |
|
10 | 10 |
|
11 | 11 | from ietf.name.resources import BallotPositionNameResource, DocTypeNameResource |
@@ -179,6 +179,53 @@ class Meta: |
179 | 179 | } |
180 | 180 | api.doc.register(StateDocEventResource()) |
181 | 181 |
|
| 182 | +from ietf.person.resources import PersonResource, EmailResource |
| 183 | +from ietf.group.resources import GroupResource |
| 184 | +from ietf.name.resources import StdLevelNameResource, StreamNameResource, DocTypeNameResource, DocTagNameResource, IntendedStdLevelNameResource |
| 185 | +class DocHistoryResource(ModelResource): |
| 186 | + type = ToOneField(DocTypeNameResource, 'type', null=True) |
| 187 | + stream = ToOneField(StreamNameResource, 'stream', null=True) |
| 188 | + group = ToOneField(GroupResource, 'group', null=True) |
| 189 | + intended_std_level = ToOneField(IntendedStdLevelNameResource, 'intended_std_level', null=True) |
| 190 | + std_level = ToOneField(StdLevelNameResource, 'std_level', null=True) |
| 191 | + ad = ToOneField(PersonResource, 'ad', null=True) |
| 192 | + shepherd = ToOneField(EmailResource, 'shepherd', null=True) |
| 193 | + doc = ToOneField(DocumentResource, 'doc') |
| 194 | + states = ToManyField(StateResource, 'states', null=True) |
| 195 | + tags = ToManyField(DocTagNameResource, 'tags', null=True) |
| 196 | + authors = ToManyField(EmailResource, 'authors', null=True) |
| 197 | + class Meta: |
| 198 | + queryset = DocHistory.objects.all() |
| 199 | + serializer = api.Serializer() |
| 200 | + #resource_name = 'dochistory' |
| 201 | + filtering = { |
| 202 | + "id": ALL, |
| 203 | + "time": ALL, |
| 204 | + "title": ALL, |
| 205 | + "abstract": ALL, |
| 206 | + "rev": ALL, |
| 207 | + "pages": ALL, |
| 208 | + "order": ALL, |
| 209 | + "expires": ALL, |
| 210 | + "notify": ALL, |
| 211 | + "external_url": ALL, |
| 212 | + "note": ALL, |
| 213 | + "internal_comments": ALL, |
| 214 | + "name": ALL, |
| 215 | + "type": ALL_WITH_RELATIONS, |
| 216 | + "stream": ALL_WITH_RELATIONS, |
| 217 | + "group": ALL_WITH_RELATIONS, |
| 218 | + "intended_std_level": ALL_WITH_RELATIONS, |
| 219 | + "std_level": ALL_WITH_RELATIONS, |
| 220 | + "ad": ALL_WITH_RELATIONS, |
| 221 | + "shepherd": ALL_WITH_RELATIONS, |
| 222 | + "doc": ALL_WITH_RELATIONS, |
| 223 | + "states": ALL_WITH_RELATIONS, |
| 224 | + "tags": ALL_WITH_RELATIONS, |
| 225 | + "authors": ALL_WITH_RELATIONS, |
| 226 | + } |
| 227 | +api.doc.register(DocHistoryResource()) |
| 228 | + |
182 | 229 | from ietf.person.resources import PersonResource |
183 | 230 | class ConsensusDocEventResource(ModelResource): |
184 | 231 | by = ToOneField(PersonResource, 'by') |
@@ -207,7 +254,6 @@ class Meta: |
207 | 254 | serializer = api.Serializer() |
208 | 255 | #resource_name = 'docalias' |
209 | 256 | filtering = { |
210 | | - "id": ALL, |
211 | 257 | "name": ALL, |
212 | 258 | "document": ALL_WITH_RELATIONS, |
213 | 259 | } |
@@ -336,6 +382,22 @@ class Meta: |
336 | 382 | } |
337 | 383 | api.doc.register(InitialReviewDocEventResource()) |
338 | 384 |
|
| 385 | +from ietf.person.resources import EmailResource |
| 386 | +class DocHistoryAuthorResource(ModelResource): |
| 387 | + document = ToOneField(DocHistoryResource, 'document') |
| 388 | + author = ToOneField(EmailResource, 'author') |
| 389 | + class Meta: |
| 390 | + queryset = DocHistoryAuthor.objects.all() |
| 391 | + serializer = api.Serializer() |
| 392 | + #resource_name = 'dochistoryauthor' |
| 393 | + filtering = { |
| 394 | + "id": ALL, |
| 395 | + "order": ALL, |
| 396 | + "document": ALL_WITH_RELATIONS, |
| 397 | + "author": ALL_WITH_RELATIONS, |
| 398 | + } |
| 399 | +api.doc.register(DocHistoryAuthorResource()) |
| 400 | + |
339 | 401 | from ietf.person.resources import PersonResource |
340 | 402 | class BallotDocEventResource(ModelResource): |
341 | 403 | by = ToOneField(PersonResource, 'by') |
@@ -375,54 +437,22 @@ class Meta: |
375 | 437 | } |
376 | 438 | api.doc.register(RelatedDocumentResource()) |
377 | 439 |
|
378 | | -from ietf.person.resources import PersonResource, EmailResource |
379 | | -from ietf.group.resources import GroupResource |
380 | | -from ietf.name.resources import StdLevelNameResource, StreamNameResource, DocTypeNameResource, DocTagNameResource, IntendedStdLevelNameResource |
381 | | -class DocHistoryResource(ModelResource): |
382 | | - type = ToOneField(DocTypeNameResource, 'type', null=True) |
383 | | - stream = ToOneField(StreamNameResource, 'stream', null=True) |
384 | | - group = ToOneField(GroupResource, 'group', null=True) |
385 | | - intended_std_level = ToOneField(IntendedStdLevelNameResource, 'intended_std_level', null=True) |
386 | | - std_level = ToOneField(StdLevelNameResource, 'std_level', null=True) |
387 | | - ad = ToOneField(PersonResource, 'ad', null=True) |
388 | | - shepherd = ToOneField(EmailResource, 'shepherd', null=True) |
389 | | - doc = ToOneField(DocumentResource, 'doc') |
390 | | - states = ToManyField(StateResource, 'states', null=True) |
391 | | - tags = ToManyField(DocTagNameResource, 'tags', null=True) |
392 | | - related = ToManyField(DocAliasResource, 'related', null=True) |
393 | | - authors = ToManyField(EmailResource, 'authors', null=True) |
| 440 | +from ietf.name.resources import DocRelationshipNameResource |
| 441 | +class RelatedDocHistoryResource(ModelResource): |
| 442 | + source = ToOneField(DocHistoryResource, 'source') |
| 443 | + target = ToOneField(DocAliasResource, 'target') |
| 444 | + relationship = ToOneField(DocRelationshipNameResource, 'relationship') |
394 | 445 | class Meta: |
395 | | - queryset = DocHistory.objects.all() |
| 446 | + queryset = RelatedDocHistory.objects.all() |
396 | 447 | serializer = api.Serializer() |
397 | | - #resource_name = 'dochistory' |
| 448 | + #resource_name = 'relateddochistory' |
398 | 449 | filtering = { |
399 | 450 | "id": ALL, |
400 | | - "time": ALL, |
401 | | - "title": ALL, |
402 | | - "abstract": ALL, |
403 | | - "rev": ALL, |
404 | | - "pages": ALL, |
405 | | - "order": ALL, |
406 | | - "expires": ALL, |
407 | | - "notify": ALL, |
408 | | - "external_url": ALL, |
409 | | - "note": ALL, |
410 | | - "internal_comments": ALL, |
411 | | - "name": ALL, |
412 | | - "type": ALL_WITH_RELATIONS, |
413 | | - "stream": ALL_WITH_RELATIONS, |
414 | | - "group": ALL_WITH_RELATIONS, |
415 | | - "intended_std_level": ALL_WITH_RELATIONS, |
416 | | - "std_level": ALL_WITH_RELATIONS, |
417 | | - "ad": ALL_WITH_RELATIONS, |
418 | | - "shepherd": ALL_WITH_RELATIONS, |
419 | | - "doc": ALL_WITH_RELATIONS, |
420 | | - "states": ALL_WITH_RELATIONS, |
421 | | - "tags": ALL_WITH_RELATIONS, |
422 | | - "related": ALL_WITH_RELATIONS, |
423 | | - "authors": ALL_WITH_RELATIONS, |
| 451 | + "source": ALL_WITH_RELATIONS, |
| 452 | + "target": ALL_WITH_RELATIONS, |
| 453 | + "relationship": ALL_WITH_RELATIONS, |
424 | 454 | } |
425 | | -api.doc.register(DocHistoryResource()) |
| 455 | +api.doc.register(RelatedDocHistoryResource()) |
426 | 456 |
|
427 | 457 | from ietf.person.resources import PersonResource |
428 | 458 | from ietf.name.resources import BallotPositionNameResource |
@@ -455,36 +485,3 @@ class Meta: |
455 | 485 | } |
456 | 486 | api.doc.register(BallotPositionDocEventResource()) |
457 | 487 |
|
458 | | -from ietf.person.resources import EmailResource |
459 | | -class DocHistoryAuthorResource(ModelResource): |
460 | | - document = ToOneField(DocHistoryResource, 'document') |
461 | | - author = ToOneField(EmailResource, 'author') |
462 | | - class Meta: |
463 | | - queryset = DocHistoryAuthor.objects.all() |
464 | | - serializer = api.Serializer() |
465 | | - #resource_name = 'dochistoryauthor' |
466 | | - filtering = { |
467 | | - "id": ALL, |
468 | | - "order": ALL, |
469 | | - "document": ALL_WITH_RELATIONS, |
470 | | - "author": ALL_WITH_RELATIONS, |
471 | | - } |
472 | | -api.doc.register(DocHistoryAuthorResource()) |
473 | | - |
474 | | -from ietf.name.resources import DocRelationshipNameResource |
475 | | -class RelatedDocHistoryResource(ModelResource): |
476 | | - source = ToOneField(DocHistoryResource, 'source') |
477 | | - target = ToOneField(DocAliasResource, 'target') |
478 | | - relationship = ToOneField(DocRelationshipNameResource, 'relationship') |
479 | | - class Meta: |
480 | | - queryset = RelatedDocHistory.objects.all() |
481 | | - serializer = api.Serializer() |
482 | | - #resource_name = 'relateddochistory' |
483 | | - filtering = { |
484 | | - "id": ALL, |
485 | | - "source": ALL_WITH_RELATIONS, |
486 | | - "target": ALL_WITH_RELATIONS, |
487 | | - "relationship": ALL_WITH_RELATIONS, |
488 | | - } |
489 | | -api.doc.register(RelatedDocHistoryResource()) |
490 | | - |
0 commit comments