Пример #1
0
 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
 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
 def dispatch_request(self, id, account):
     super(AccountNewAddressView, self).dispatch_request(id, account)
     newaddress = self.conn.getnewaddress(self.account)
     flash(u"New address for %s: %s" % (self.account, newaddress),
           'success')
     return redirect(url_for("wallet.account_detail", id=id,
                     account=human_format(self.account)))
Пример #4
0
def accountformat(account):
    return human_format(account)
Пример #5
0
def accountformat(account):
    return human_format(account)