def mep_changes(d_id): c = mep(d_id, None) if not c: abort(404) changes = [(date, change) for date, change in c["changes"].items()] updated = max(changes, key=itemgetter(0))[0] changes = [{"changes": {date: change}} for date, change in sorted(changes, key=itemgetter(0), reverse=True)] return render_template("changes_atom.xml", updated=updated, changes=changes, path="/mep/%s" % d_id)
def mep_changes(d_id): c=mep(d_id,None) if not c: abort(404) changes=[(date, change) for date,change in c['changes'].items()] updated=max(changes, key=itemgetter(0))[0] changes=[{'changes': {date: change}} for date, change in sorted(changes, key=itemgetter(0), reverse=True)] return render_template('changes_atom.xml', updated=updated, changes=changes, path='/mep/%s' % d_id)
def view_mep(d_id): from parltrack.views.views import mep m=mep(d_id) if not m: abort(404) if request.args.get('format','')=='json': return jsonify(tojson(m)) return render_template('mep.html', mep=m, d=d_id, group_cutoff=datetime(2004,7,20), today=datetime.now(), url=request.base_url)
def view_mep(d_id): date=None if request.args.get('date'): date=getDate() m=mep(d_id,date) if not m: abort(404) if request.args.get('format','')=='json' or request.headers.get('X-Requested-With') or request.headers.get('Accept')=='text/json': return jsonify(tojson(m)) return render_template('mep.html', mep=m, d=d_id, group_cutoff=datetime(2004,7,20), today=datetime.now(), url=request.base_url)
def view_mep(d_id): date=None if request.args.get('date'): date=getDate() m=mep(d_id,date) if not m: abort(404) if request.args.get('format','')=='json': return jsonify(tojson(m)) m['CV']=m.get('Curriculum vitae',[]) return render_template('mep.html', mep=m, d=d_id, group_cutoff=datetime(2004,7,20), today=datetime.now(), url=request.base_url)
def view_mep(d_id): date = None if request.args.get('date'): date = getDate() m = mep(d_id, date) if not m: abort(404) if request.args.get('format', '') == 'json': return jsonify(tojson(m)) m['CV'] = m.get('Curriculum vitae', []) return render_template('mep.html', mep=m, d=d_id, group_cutoff=datetime(2004, 7, 20), today=datetime.now(), url=request.base_url)
def view_mep(d_id): date = None if request.args.get("date"): date = getDate() m = mep(d_id, date) if not m: abort(404) if ( request.args.get("format", "") == "json" or request.headers.get("X-Requested-With") or request.headers.get("Accept") == "text/json" ): return jsonify(tojson(m)) return render_template( "mep.html", mep=m, d=d_id, group_cutoff=datetime(2004, 7, 20), today=datetime.now(), url=request.base_url )