web2py 2.18.5: LOAD bugs?

75 views
Skip to first unread message

Toan Le

unread,
Feb 4, 2020, 8:07:22 AM2/4/20
to web2py-users
Hi all,

I found this bugs at def LOAD(), gluon/compileapp.py, line 213:

other_request.env.query_string = \
            vars and URL(vars=vars).split('?')[1] or ''
It has an error when URL(vars=vars).split('?') = []

Regards.

Massimo Di Pierro

unread,
Feb 10, 2020, 12:59:58 AM2/10/20
to web2py-users
Would you mind opening a web2py ticket about this?

Toan Le

unread,
Feb 10, 2020, 9:41:54 PM2/10/20
to web2py-users

Controller:

def test():
    return H3("Hello")

def grid():
    tablename = request.args(0) or "auth_user"
    if not tablename in db.tables: raise HTTP(403)
    grid = SQLFORM.smartgrid(db[tablename], args=[tablename], deletable=False, editable=False)
    return dict(grid=grid)

View: grid.html
    {{=LOAD(f="test",vars=request.vars)}}
    {{=grid}}


Traceback

1.
2.
3.
4.
5.
6.
7.
8.
Traceback (most recent call last):
File "C:\Users\toan7\OneDrive\web2py\gluon\restricted.py", line 219, in restricted
exec(ccode, environment)
File "C:\Users\toan7\OneDrive\web2py\applications\welcome\views\default/grid.html", line 181, in <module>
File "C:\Users\toan7\OneDrive\web2py\gluon\compileapp.py", line 214, in LOAD

vars and URL(vars=vars).split('?')[1] or ''
IndexError: list index out of range

Massimo Di Pierro

unread,
Feb 15, 2020, 6:18:55 AM2/15/20
to web2py-users
works for me. can you try print vars and URL(vars=vars)?

Toan Le

unread,
Feb 19, 2020, 2:40:55 AM2/19/20
to web2py-users


My OS is windows 10.
print vars and URL(vars=vars):

<Storage {'records': []}> /welcome/default/grid
Reply all
Reply to author
Forward
0 new messages