From 2df788a0233c2c3462305d01e4abbaec177c637d Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Sat, 21 Mar 2009 21:37:55 +0000 Subject: [PATCH] New code from Pasi for a machine-readadable page giving the documents on the next iesg agenda. - Legacy-Id: 1389 --- ietf/iesg/urls.py | 1 + ietf/iesg/views.py | 13 +++++++-- ietf/templates/iesg/agenda_documents.txt | 34 ++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 ietf/templates/iesg/agenda_documents.txt diff --git a/ietf/iesg/urls.py b/ietf/iesg/urls.py index 373f38656..d933a3cdd 100644 --- a/ietf/iesg/urls.py +++ b/ietf/iesg/urls.py @@ -65,6 +65,7 @@ urlpatterns += patterns('django.views.generic.list_detail', urlpatterns += patterns('', (r'^agenda/$', views.telechat_agenda), + (r'^agenda/documents.txt$', views.telechat_agenda_documents), (r'^ann/ind/$',views.inddocs), (r'^ann/(?P[^/]+)/$',views.wgdocs), ) diff --git a/ietf/iesg/views.py b/ietf/iesg/views.py index 99de0f15e..a9e1a18e9 100644 --- a/ietf/iesg/views.py +++ b/ietf/iesg/views.py @@ -36,8 +36,8 @@ #from django.views.generic.date_based import archive_index from ietf.idtracker.models import IDInternal, InternetDraft,AreaGroup,IETFWG from django.views.generic.list_detail import object_list -from django.http import Http404 -from django.template import RequestContext +from django.http import Http404, HttpResponse +from django.template import RequestContext, Context, loader from django.shortcuts import render_to_response from ietf.iesg.models import TelechatDates, TelechatAgendaItem, WGAction import datetime @@ -160,3 +160,12 @@ def telechat_agenda(request, date=None): private = 'private' in request.REQUEST return render_to_response('iesg/agenda.html', {'date':str(date), 'docs':docs,'mgmt':mgmt,'wgs':wgs, 'private':private}, context_instance=RequestContext(request) ) + +def telechat_agenda_documents(request): + dates = TelechatDates.objects.all()[0].dates() + docs = [] + for date in dates: + docs.extend(IDInternal.objects.filter(telechat_date=date, primary_flag=1, agenda=1)) + t = loader.get_template('iesg/agenda_documents.txt') + c = Context({'docs':docs}) + return HttpResponse(t.render(c), mimetype='text/plain') diff --git a/ietf/templates/iesg/agenda_documents.txt b/ietf/templates/iesg/agenda_documents.txt new file mode 100644 index 000000000..634674de6 --- /dev/null +++ b/ietf/templates/iesg/agenda_documents.txt @@ -0,0 +1,34 @@ +{% comment %} +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +All rights reserved. Contact: Pasi Eronen + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the Nokia Corporation and/or its + subsidiary(-ies) nor the names of its contributors may be used + to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +{% endcomment %}# Fields: telechat date, filename (draft-foo-bar or rfc1234), intended status, rfc editor submission flag (0=no, 1=yes), area acronym, AD name{% for doc in docs %} +{{ doc.telechat_date }} {{ doc.document.filename }} {{ doc.document.intended_status }} {{doc.via_rfc_editor}} {{doc.area_acronym|lower}} {{doc.token_name }}{% endfor %} \ No newline at end of file