Hello,

web2py newbie here.  Am using SQLTABLE and linkto, and finding it adds
an extra variable to the url when I click on a link it creates.
Relevant files:

menu.py (the following works fine  as a one entry in a longer list):
…
[T('Profession'), False, URL(request.application,'default',
'profession')],
…



default.py:
def profession():
    if request.args:
 response.view = 'default/crud.html'
       return dict(form = crud.update(
            db.profession,
            request.args[1],
            next = URL(r = request, f = 'profession')
        ))
    else:
        rows = db().select(db.profession.ALL)
        response.view = 'default/table.html'
        return dict(table = SQLTABLE(
            rows,
linkto = URL(r=request)
        ))



Entering

http://127.0.0.1:8000/conted/default/profession

works great – returns a page with a nice table.  Clicking on an id 1
as hyperlink in the table creates

http://127.0.0.1:8000/conted/default/profession/profession/1

This returns a form to edit the record.  However, see how ‘profession’
has been duplicated?  What I would prefer instead is

http://127.0.0.1:8000/conted/default/profession/1


Is what I want possible (or even desirable?).  I may be approaching
this completely wrong.  If so, would appreciate a hint in the right
direction.

Thanks in advance,

R

Reply via email to