def bankdetail(bid): result = (None, None) try: if request.method == 'POST' or len(bid)==11: bank = Bank(db.connect_db(), session['uid']) result = bank.entrance(bid) (msg, arg) = result session['bid'] = bank.bankid datas = bank.bankdata() dataes = [] dayta = [] for (pid, bid, date, value) in datas: if len(dayta) and dayta[0][2] != date[5:]: dataes.append(dayta) dayta = [] dayta.append((pid, bid, date[5:], value)) dataes.append(dayta) if msg == None: return render_template('bankdetail.html', entries=(bid, bank.bankname), dataes=dataes, error=msg) else: raise 'TypeError' else: return redirect(url_for(bid)) except: flash('비정상적인 시도입니다.') return redirect(url_for('front'))
def mypage(): result = (None, None) try: if(session['uid']): bank = Bank(db.connect_db(), session['uid']) blist = bank.banklist() return render_template('mypage.html', entries=blist, error=None) except: flash('비정상적인 시도입니다.') return redirect(url_for('front'))
def bankreg(): result = (None, None) if request.method == 'POST': bankname = request.form['bankname'] bankid = request.form['bankid'] bankid = bankid.replace('-', '') bank = Bank(db.connect_db(), session['uid']) result = bank.register(bankid, bankname) return render_redirect('bankreg.html', 'mypage', result) else: try: if session['signin']: return render_template('bankreg.html', error=None) except: flash('비정상적인 시도입니다.') return redirect(url_for('front'))