datatracker/ietf/ipr/related.py
Robert Sparks a593fec06e * Made reporting IPR consistant across document searches, IPR searches, AD document queues, last calls, and agendas. All these points now report on the document(s) being directly queried, and the documents those transitively replace or obsolete.
* Brought search results against WGs and document titles into consistency with results from searching for individual documents
* Added the IPR count to the link on the documents main page (when not zero)
* Built on Henrik's reimplementation of all_related_*, making the *_related_* functions return DocAlias lists consistently, and added corresponding _relations_ functions to get lists of actual RelatedDocument objects.
* Added getting the DocAlias with the same name to Document
* Added getting related IPR disclosures (as described in the first bullet) to Document
* Simplified ipr/related.py
* Removed the use of DraftLikeDocAlias and IETFWG from ipr/search.py. Retooled the various search functions and templates to use DocAlias and IprDocAlias directly.
* Removed dead code from ipr/search.py
* Removed the special handling of WG 2000 from ipr/search.py

Fixes bug 1071
 - Legacy-Id: 6042
2013-08-12 21:41:57 +00:00

16 lines
475 B
Python

# Copyright The IETF Trust 2007, All Rights Reserved
def related_docs(alias):
results = list(alias.document.docalias_set.all())
rels = alias.document.all_relations_that_doc(['replaces','obs'])
for rel in rels:
rel_aliases = list(rel.target.document.docalias_set.all())
for x in rel_aliases:
x.related = rel
x.relation = rel.relationship.revname
results += rel_aliases
return list(set(results))