コード例 #1
0
ファイル: wallet.py プロジェクト: oditorium/flaskwallet
 def dispatch_request(self, id):
     super(WalletMoveView, self).dispatch_request(id)
     form = AccountMoveForm(request.form)
     choices = get_accounts(self.conn, getchoice=True)
     form.fromaccount.choices = choices
     form.toaccount.choices = choices
     accounts = get_accounts(self.conn, getbalance=True)
     fromaccount = urllib.unquote_plus(form.data['fromaccount'])
     toaccount = urllib.unquote_plus(form.data['toaccount'])
     fromaccount = real_format(fromaccount)
     toaccount = real_format(toaccount)
     if request.method == 'POST' and form.validate():
         amount = strtofloat(form.data['amount'])
         self.conn.move(
             fromaccount,
             toaccount,
             amount,
             int(get_setting('minconf', 6)),
             form.data['comment'],
         )
         flash(
             u"%f coins moved from %s to %s" %
             (amount, human_format(fromaccount), human_format(toaccount)),
             'success')
         return redirect(url_for('wallet.wallet_detail', id=id))
     return render_template("wallet/wallet/move.html",
                            wallet=self.wallet,
                            form=form,
                            accounts=accounts)
コード例 #2
0
ファイル: wallet.py プロジェクト: CryptArc/flaskwallet
 def dispatch_request(self, id):
     super(WalletMoveView, self).dispatch_request(id)
     form = AccountMoveForm(request.form)
     choices = get_accounts(self.conn, getchoice=True)
     form.fromaccount.choices = choices
     form.toaccount.choices = choices
     accounts = get_accounts(self.conn, getbalance=True)
     fromaccount = urllib.unquote_plus(form.data['fromaccount'])
     toaccount = urllib.unquote_plus(form.data['toaccount'])
     fromaccount = real_format(fromaccount)
     toaccount = real_format(toaccount)
     if request.method == 'POST' and form.validate():
         amount = strtofloat(form.data['amount'])
         self.conn.move(
             fromaccount,
             toaccount,
             amount,
             int(get_setting('minconf', 6)),
             form.data['comment'],
         )
         flash(u"%f coins moved from %s to %s" % (amount,
               human_format(fromaccount), human_format(toaccount)),
               'success')
         return redirect(url_for('wallet.wallet_detail', id=id))
     return render_template("wallet/wallet/move.html", wallet=self.wallet,
                            form=form, accounts=accounts)
コード例 #3
0
ファイル: account.py プロジェクト: CryptArc/flaskwallet
 def dispatch_request(self, id, account):
     super(AccountUnlockedBase, self).dispatch_request(id)
     account = urllib.unquote(account).decode('utf8')
     self.account = real_format(account)