-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in Roberts django-based replacement for the old perl script ge…
…nerating all_id.txt - Legacy-Id: 1398
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python | ||
|
||
from django.template.loader import render_to_string | ||
|
||
from ietf.idtracker.models import IDInternal | ||
from ietf.idtracker.models import InternetDraft | ||
from ietf.idtracker.models import IDStatus | ||
|
||
|
||
# This block feels to me like it still knows _way_ too much about the insides of the model - should all of it be moved into the model itself? | ||
# select_related actually causes the wrong thing to happen because of reference problems in the tables | ||
#all_ids = InternetDraft.objects.order_by('filename').select_related(depth=1) | ||
all_ids = InternetDraft.objects.order_by('filename') | ||
in_track_ids = all_ids.filter(idinternal__rfc_flag=0).exclude(idinternal__cur_state__in=IDInternal.INACTIVE_STATES) | ||
exclude_ids = [item.id_document_tag for item in in_track_ids] | ||
not_in_track = all_ids.exclude(id_document_tag__in=exclude_ids) | ||
active = not_in_track.filter(status__status_id=IDInternal.ACTIVE) | ||
published = not_in_track.filter(status__status_id=IDInternal.PUBLISHED) | ||
expired = not_in_track.filter(status__status_id=IDInternal.EXPIRED) | ||
withdrawn_submitter = not_in_track.filter(status__status_id=IDInternal.WITHDRAWN_SUBMITTER) | ||
withdrawn_ietf = not_in_track.filter(status__status_id=IDInternal.WITHDRAWN_IETF) | ||
replaced = not_in_track.filter(status__status_id=IDInternal.REPLACED) | ||
|
||
# If all of that moved, then this file would just be the following line, with, for example, the bare | ||
# in_track_ids turned into something like InternetDraft.in_track_ids() | ||
|
||
print render_to_string("idindex/all_ids.txt",{ 'in_track_ids':in_track_ids, | ||
'active':active, | ||
'published':published, | ||
'expired':expired, | ||
'withdrawn_submitter':withdrawn_submitter, | ||
'withdrawn_ietf':withdrawn_ietf, | ||
'replaced':replaced}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
Internet-Drafts Status Summary | ||
|
||
Web version is available at | ||
https://datatracker.ietf.org/public/idindex.cgi | ||
|
||
|
||
{% for item in in_track_ids %}{{ item.filename }}-{{ item.revision_display }} {{ item.revision_date|default_if_none:"" }} In IESG processing - ID Tracker state <{{ item.idstate }}> {# that last tab is on purpose #} | ||
{% endfor %}{# | ||
#}{% for item in active %}{{ item.filename }}-{{ item.revision_display }} {{ item.revision_date|default_if_none:"" }} {{ item.status.status }} {# keep that last tab #} | ||
{% endfor %}{# | ||
#}{% for item in published %}{{ item.filename }}-{{ item.revision_display }} {{ item.revision_date|default_if_none:"" }} {{ item.status.status }} {{ item.rfc_number }} | ||
{% endfor %}{# | ||
#}{% for item in expired %}{{ item.filename }}-{{ item.revision_display }} {{ item.revision_date|default_if_none:"" }} {{ item.status.status }} {# keep that last tab #} | ||
{% endfor %}{# | ||
#}{% for item in withdrawn_submitter %}{{ item.filename }}-{{ item.revision_display }} {{ item.revision_date|default_if_none:"" }} {{ item.status.status }} {# keep that last tab #} | ||
{% endfor %}{# | ||
#}{% for item in withdrawn_ietf %}{{ item.filename }}-{{ item.revision_display }} {{ item.revision_date|default_if_none:"" }} {{ item.status.status }} {# keep that last tab #} | ||
{% endfor %}{# | ||
#}{% for item in replaced %}{{ item.filename }}-{{ item.revision_display }} {{ item.revision_date|default_if_none:"" }} {{ item.status.status }} replaced by {% if item.replaced_by_id %}{{ item.replaced_by.filename }}{% else %}0{% endif %} {# and this one needs the trailing tab as well #} | ||
{% endfor %} |