Changed calls to .related_that*() and .relations_that*() to use tuples rather than lists (a slight optimization).
- Legacy-Id: 15029
This commit is contained in:
parent
9e51072bbe
commit
ea7728b501
|
@ -870,12 +870,12 @@ def document_shepherd_writeup(request, name):
|
|||
|
||||
def document_references(request, name):
|
||||
doc = get_object_or_404(Document,docalias__name=name)
|
||||
refs = doc.relations_that_doc(['refnorm','refinfo','refunk','refold'])
|
||||
refs = doc.relations_that_doc(('refnorm','refinfo','refunk','refold'))
|
||||
return render(request, "doc/document_references.html",dict(doc=doc,refs=sorted(refs,key=lambda x:x.target.name),))
|
||||
|
||||
def document_referenced_by(request, name):
|
||||
doc = get_object_or_404(Document,docalias__name=name)
|
||||
refs = doc.relations_that(['refnorm','refinfo','refunk','refold']).filter(source__states__type__slug='draft',source__states__slug__in=['rfc','active'])
|
||||
refs = doc.relations_that(('refnorm','refinfo','refunk','refold')).filter(source__states__type__slug='draft',source__states__slug__in=['rfc','active'])
|
||||
full = ( request.GET.get('full') != None )
|
||||
numdocs = refs.count()
|
||||
if not full and numdocs>250:
|
||||
|
|
|
@ -168,7 +168,7 @@ class IprTests(TestCase):
|
|||
|
||||
def test_iprs_for_drafts_recursive(self):
|
||||
draft = make_test_data()
|
||||
replaced = draft.all_related_that_doc(['replaces'])
|
||||
replaced = draft.all_related_that_doc('replaces')
|
||||
ipr = IprDisclosureBase.objects.get(title='Statement regarding rights')
|
||||
r = self.client.get(urlreverse("ietf.ipr.views.by_draft_recursive_txt"))
|
||||
self.assertEqual(r.status_code, 200)
|
||||
|
|
|
@ -461,7 +461,7 @@ def by_draft_recursive_txt(request):
|
|||
alias = o.document
|
||||
document = alias.document
|
||||
name = alias.name
|
||||
related = set(document.docalias_set.all()) | set(document.all_related_that_doc(['obs', 'replaces']))
|
||||
related = set(document.docalias_set.all()) | set(document.all_related_that_doc(('obs', 'replaces')))
|
||||
for alias in related:
|
||||
name = alias.name
|
||||
if name.startswith("rfc"):
|
||||
|
@ -671,7 +671,7 @@ def search(request):
|
|||
docs = related_docs(first)
|
||||
iprs = iprs_from_docs(docs,states=states)
|
||||
template = "ipr/search_doc_result.html"
|
||||
updated_docs = related_docs(first, ['updates',])
|
||||
updated_docs = related_docs(first, ('updates',))
|
||||
related_iprs = list(set(iprs_from_docs(updated_docs, states=states)) - set(iprs))
|
||||
# multiple matches, select just one
|
||||
elif start:
|
||||
|
|
|
@ -91,35 +91,35 @@ class Recipient(models.Model):
|
|||
def gather_doc_affecteddoc_authors(self, **kwargs):
|
||||
addrs = []
|
||||
if 'doc' in kwargs:
|
||||
for reldoc in kwargs['doc'].related_that_doc(['conflrev','tohist','tois','tops']):
|
||||
for reldoc in kwargs['doc'].related_that_doc(('conflrev','tohist','tois','tops')):
|
||||
addrs.extend(Recipient.objects.get(slug='doc_authors').gather(**{'doc':reldoc.document}))
|
||||
return addrs
|
||||
|
||||
def gather_doc_affecteddoc_group_chairs(self, **kwargs):
|
||||
addrs = []
|
||||
if 'doc' in kwargs:
|
||||
for reldoc in kwargs['doc'].related_that_doc(['conflrev','tohist','tois','tops']):
|
||||
for reldoc in kwargs['doc'].related_that_doc(('conflrev','tohist','tois','tops')):
|
||||
addrs.extend(Recipient.objects.get(slug='doc_group_chairs').gather(**{'doc':reldoc.document}))
|
||||
return addrs
|
||||
|
||||
def gather_doc_affecteddoc_notify(self, **kwargs):
|
||||
addrs = []
|
||||
if 'doc' in kwargs:
|
||||
for reldoc in kwargs['doc'].related_that_doc(['conflrev','tohist','tois','tops']):
|
||||
for reldoc in kwargs['doc'].related_that_doc(('conflrev','tohist','tois','tops')):
|
||||
addrs.extend(Recipient.objects.get(slug='doc_notify').gather(**{'doc':reldoc.document}))
|
||||
return addrs
|
||||
|
||||
def gather_conflict_review_stream_manager(self, **kwargs):
|
||||
addrs = []
|
||||
if 'doc' in kwargs:
|
||||
for reldoc in kwargs['doc'].related_that_doc(['conflrev']):
|
||||
for reldoc in kwargs['doc'].related_that_doc(('conflrev',)):
|
||||
addrs.extend(Recipient.objects.get(slug='doc_stream_manager').gather(**{'doc':reldoc.document}))
|
||||
return addrs
|
||||
|
||||
def gather_conflict_review_steering_group(self,**kwargs):
|
||||
addrs = []
|
||||
if 'doc' in kwargs:
|
||||
for reldoc in kwargs['doc'].related_that_doc(['conflrev']):
|
||||
for reldoc in kwargs['doc'].related_that_doc(('conflrev',)):
|
||||
if reldoc.document.stream_id=='irtf':
|
||||
addrs.append('"Internet Research Steering Group" <irsg@irtf.org>')
|
||||
return addrs
|
||||
|
|
Loading…
Reference in a new issue