Skip to content

Commit d481019

Browse files
committed
Added reverse relationships from drafts to submissions to submission checks to the Json API, to make it easier to find the yang checks for a given document.
- Legacy-Id: 13785
1 parent c69d09e commit d481019

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

ietf/doc/resources.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class DocumentResource(ModelResource):
100100
states = ToManyField(StateResource, 'states', null=True)
101101
tags = ToManyField(DocTagNameResource, 'tags', null=True)
102102
rfc = CharField(attribute='rfc_number', null=True)
103+
submissions = ToManyField('ietf.submit.resources.SubmissionResource', 'submission_set', null=True)
103104
class Meta:
104105
cache = SimpleCache()
105106
queryset = Document.objects.all()

ietf/submit/resources.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Autogenerated by the mkresources management command 2014-11-13 23:53
22
from ietf.api import ModelResource
3-
from tastypie.fields import ToOneField
3+
from tastypie.fields import ToOneField, ToManyField
44
from tastypie.constants import ALL, ALL_WITH_RELATIONS
55
from tastypie.cache import SimpleCache
66

@@ -32,6 +32,7 @@ class SubmissionResource(ModelResource):
3232
state = ToOneField(DraftSubmissionStateNameResource, 'state')
3333
group = ToOneField(GroupResource, 'group', null=True)
3434
draft = ToOneField(DocumentResource, 'draft', null=True)
35+
checks = ToManyField('ietf.submit.resources.SubmissionCheckResource', 'checks', null=True)
3536
class Meta:
3637
cache = SimpleCache()
3738
queryset = Submission.objects.all()

0 commit comments

Comments
 (0)