Hi,
I've seen an unexpected 'SQLTABLE linkto' behaviour (both at 2.8.2 and trunk version):
In a controller:
def sqltablelinkto():
db = DAL('sqlite:memory:')
db.define_table('parent',Field('name'))
db.parent.insert(name='Parent1')
db.parent.insert(name='Parent2')
l = URL('')
return CAT(H5('request.args=%s' % request.args),
H5('request.vars=%s' % request.vars),
SQLTABLE(db(db.parent).select(), linkto=l))
This works as expected when you click at the id links: name of table and id of record are passed to args, and nothing to vars. URLs are formed like this: http://.../sqltablelinkto/parent/1
But if you want to pass something in vars, things get weird.
Change the url line to:
l = URL('', vars=dict(data='data in vars'))
Now, when you click at the id links, you get NOTHING at request.args, and all the info is mixed up at request.vars: 'data': 'data in vars/parent/1'
The formed url shows the reason: http://.../sqltablelinkto?data=data+in+vars/parent/1
I expected this url to be formed: http://.../sqltablelinkto/parent/1?data=data+in+vars
so you'll get args and vars stored properly.
Am i doing something wrong or should i open a bug ticket?.
Thanks!