I see. Thanks Anthony
On Thursday, May 19, 2016 at 3:09:52 AM UTC-7, Anthony wrote:
>
> Though generally it is good to minimize the logic in views, as they are
> more difficult to read, test, and debug. So, prefer moving such
> calculations to the controller, or at least to a function that is
Thanks a million.
On Wednesday, May 18, 2016 at 10:11:40 PM UTC-7, 黄祥 wrote:
>
> just do like usual in controller
> e.g.
> *controllers/default.py*
> def report_investor():
> choose_investor = request.args(0)
> # query
> query_account = (db.account.investor == choose_investor)
>
> # row
> rows_a
Though generally it is good to minimize the logic in views, as the are more
difficult to read, test, and debug. So, prefer moving such calculations to the
controller, or at least to a function that is simply called from the view.
Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/bo
just do like usual in controller
e.g.
*controllers/default.py*
def report_investor():
choose_investor = request.args(0)
# query
query_account = (db.account.investor == choose_investor)
# row
rows_account = db(query_account).select(orderby = ~db.account.id)
return dict(rows_account = rows_account)
4 matches
Mail list logo