def edel(ev): if request.method == 'GET': if 'username' in session: EventSQL.delEvent(ev) return redirect(url_for('panel')) else: return redirect(url_for('panel'))
def eadd(): if request.method == 'POST': if 'username' in session: name = request.form['name'] date = request.form['date'] EventSQL.addEvent(name, date) return redirect(url_for('panel')) else: return 'nologin'
def index(): elist = EventSQL.listEvent(3) if elist == [] : E1Name = '尚未決定' # NOQA E1D = '尚未決定' # NOQA if not elist == []: E1Name = elist[0][0] # NOQA E2Name = elist[1][0] # NOQA E3Name = elist[2][0] # NOQA E1D = elist[0][1] # NOQA E2D = elist[1][1] # NOQA E3D = elist[2][1] # NOQA return render_template('index.html', **locals())
def panel(): if 'username' in session: elist = EventSQL.listAllEvent() return render_template('edit.html', **locals()) else: return redirect(url_for('loginp'))