X-Git-Url: https://git.siccegge.de//index.cgi?p=fachschaftentool.git;a=blobdiff_plain;f=application.py;h=c296f31413debd4352aaf81e859c66537f3835ea;hp=8ceb6c9e74c6bf45737c884ea7179d47abd22d25;hb=9b85c51219c8e60c9a51ac912b0be55b78356e2e;hpb=51f7d680094c33dacf0ee2dc7d120651835e5398 diff --git a/application.py b/application.py index 8ceb6c9..c296f31 100644 --- a/application.py +++ b/application.py @@ -10,8 +10,8 @@ from flask import Flask, session, redirect, url_for, escape, request, render_tem app = Flask(__name__) -#DATABASE = os.path.join(os.path.dirname(__file__), '..', 'data', 'fachschaften.sqlite') -DATABASE = os.path.join(os.path.dirname(__file__), 'fachschaften.sqlite') +DATABASE = os.path.join(os.path.dirname(__file__), '..', 'data', 'fachschaften.sqlite') +#DATABASE = os.path.join(os.path.dirname(__file__), 'fachschaften.sqlite') def get_db(): db = sqlite3.connect(DATABASE) @@ -42,13 +42,11 @@ def add_process(): db = get_db() cursor = db.cursor() data = request.form - - print data cursor.execute("INSERT INTO fachschaft " "(langname, kurzname, land, stadt, studenten, " - "organ, vertreten, organisation, fachschaftler) " - "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", + "organ, vertreten, organisation, fachschaftler, homepage) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", [data['unilang'], data['unikurz'], data['bundesland'], @@ -57,7 +55,8 @@ def add_process(): data['fsorgan'], data['vertretenestudis'], data['organisationsform'], - data['aktive']]) + data['aktive'], + data['homepage']]) rowid = cursor.lastrowid for i in range(0, 10): if data['studiengang%d' % i] != '': @@ -83,7 +82,7 @@ def download(): fachschaft = fachschaft, studiengaenge = studiengaenge) fdata = fdata.encode('utf-8') - info = tarfile.TarInfo(name=fachschaft['kurzname']) + info = tarfile.TarInfo(name='%s.tex' % fachschaft['kurzname'].strip().lower().replace(' ', '_').replace('/','_')) info.size = len(fdata) tar.addfile(info, StringIO.StringIO(fdata)) print fdata