|
42 | 42 | import re |
43 | 43 | import markdown |
44 | 44 |
|
| 45 | +from collections import defaultdict |
45 | 46 | from urllib.parse import quote |
46 | 47 |
|
47 | 48 | from django.http import HttpResponse, Http404 |
|
50 | 51 | from django.urls import reverse as urlreverse |
51 | 52 | from django.conf import settings |
52 | 53 | from django import forms |
| 54 | +from django.views.decorators.cache import cache_page |
| 55 | + |
53 | 56 |
|
54 | 57 | import debug # pyflakes:ignore |
55 | 58 |
|
56 | 59 | from ietf.doc.models import ( Document, DocAlias, DocHistory, DocEvent, BallotDocEvent, BallotType, |
57 | 60 | ConsensusDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent, IanaExpertDocEvent, |
58 | | - IESG_BALLOT_ACTIVE_STATES, STATUSCHANGE_RELATIONS, DocumentActionHolder, DocumentAuthor) |
| 61 | + IESG_BALLOT_ACTIVE_STATES, STATUSCHANGE_RELATIONS, DocumentActionHolder, DocumentAuthor, RelatedDocument) |
59 | 62 | from ietf.doc.utils import (add_links_in_new_revision_events, augment_events_with_revision, |
60 | 63 | can_adopt_draft, can_unadopt_draft, get_chartering_type, get_tags_for_stream_id, |
61 | 64 | needed_ballot_positions, nice_consensus, prettify_std_name, update_telechat, has_same_ballot, |
@@ -1714,3 +1717,16 @@ def all_presentations(request, name): |
1714 | 1717 | 'in_progress': in_progress, |
1715 | 1718 | 'past' : past+recent, |
1716 | 1719 | }) |
| 1720 | + |
| 1721 | +@cache_page ( 60 * 60, cache="slowpages" ) |
| 1722 | +def idnits2_rfcs_obsoleted(request): |
| 1723 | + |
| 1724 | + obsdict = defaultdict(list) |
| 1725 | + for r in RelatedDocument.objects.filter(relationship_id='obs'): |
| 1726 | + obsdict[int(r.target.document.rfc_number())].append(int(r.source.rfc_number())) |
| 1727 | + |
| 1728 | + for k in obsdict: |
| 1729 | + obsdict[k] = sorted(obsdict[k]) |
| 1730 | + |
| 1731 | + return render(request, 'doc/idnits2-rfcs-obsoleted.txt', context={'obsitems':sorted(obsdict.items())},content_type='text/plain;charset=utf-8') |
| 1732 | + |
0 commit comments