The fact is that is how it works but the manual may be incorrect.

linkto is used for appadmin and appadmin wants to know which od is
involved in the query,for example

db.table.field==1

so linkto has to be of the form URL('action',args='db')

It has been so for two years. It cannot be changed without breaking
appadmin.

Massimo

On Jul 22, 11:05 am, DenesL <[email protected]> wrote:
> Yes, I can reproduce it running web2py 1.97.1 from source on Windows.
>
> >>> link=URL('list_records')
> >>> print link
>
> /test/default/list_records>>> form = SQLFORM(db.person,1,linkto=link)
> >>> print form.element('#dog__owner__row')
>
> <tr id="dog__owner__row"><td class="w2p_fl"></td><td class="w2p_fw"><a
> class="reference" href="/test/default/list_records/dog?
> query=list_records.dog.owner%3D%3D1">dog.owner</a></td><td
> class="w2p_fc"></td></tr>
>
> sqlhtml.py line 845 does not seem right on getting db:
> db = linkto.split('/')[-1]
>
> but is seems strange that nobody has complained about it before since
> that has been in place for a few releases back.
>
> Denes.
>
> On Jul 21, 1:18 pm, Massimo Di Pierro <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > I cannot reproduce this. Can anybody else?
>
> > On Jul 18, 8:13 pm, tcab <[email protected]> wrote:
>
> > > Ok - added issue ashttp://code.google.com/p/web2py/issues/detail?id=340
>
> > > On Jul 15, 9:45 am, Anthony <[email protected]> wrote:
>
> > > > Please submit an issue on Google 
> > > > Code:http://code.google.com/p/web2py/issues/list
>
> > > > On Friday, July 15, 2011 1:33:22 AM UTC-4, tcab wrote:
> > > > > I get this too - a spurious "list_records." prepended to the query.
> > > > > Latest web2py 1.97.1
>
> > > > > -Andy
>
> > > > > On Jul 12, 10:08 pm, jc <[email protected]> wrote:
> > > > > > Hi,
> > > > > > Trying to uselinkto, so following example in web2py book<
> > > > >http://www.web2py.com/book/default/chapter/07#Links-to-Referencing-Re...>
> > > > > first,
> > > > > > to try to understand.
>
> > > > > > I have copied the example with person and dog tables, in particular 
> > > > > > in
> > > > > def
> > > > > > display_form(): I have
>
> > > > > > link = URL('list_records')
> > > > > > form = SQLFORM(db.person, record, deletable=True,
> > > > > >                   upload=url,linkto=link, labels = 
> > > > > > {'dog.owner':"This
> > > > > > person's dogs"})
>
> > > > > > as described in the book.
>
> > > > > > The books says the link generated will be
> > > > > > "/test/default/list_records/dog?query=dog.owner%3D5" but in fact 
> > > > > > the link
>
> > > > > > which appears when I visit /test/default/display_form/1 is
> > > > > >  "/test/default/list_records/dog?query=list_records.dog.owner%3D%3D1",
> > > > > i.e.
> > > > > > there is a spurious list.records and a spurious %3D. Not 
> > > > > > surprisingly the
>
> > > > > > link doesn't work. Can anybody tell me what I am doing wrong?
>
> > > > > > Thanks.

Reply via email to