Is there anything special that needs to be done to pass args from a
view module to a controller.
I ask as the standard code that works on a "typical" view and
controller does not work when used in jpolite:

In view module m201:

       <dd>
                <ul class="navul">
                        {{for prodj in prodj:}}
                        {{=LI(A(prodj.name,_href=URL(r=request,f='m202',args=
[prodj.id])),_id='m202')}}
                        <li id="m202">{{=prodj.name}}</li>
                        {{pass}}
                </ul>
        </dd>

in controller:

def m202():
    # try:  thisprodj=db(db.prodj.id==request.args[0]).select()[0]
    thisprodj=db(db.prodj.id==request.args[0]).select()[0]
    # except: redirect(URL(r=request,f='m202'))
    return dict(prodj=thisprodj)

in view module m202

   <h>{{=prodj.name))</h>

traceback:
Error traceback
Traceback (most recent call last):
  File "C:\APPS\web2py\gluon\restricted.py", line 107, in restricted
    exec ccode in environment
  File "C:/APPS/web2py/applications/jpolie/controllers/default.py",
line 91, in <module>
  File "C:\APPS\web2py\gluon\globals.py", line 80, in <lambda>
    self._caller = lambda f: f()
  File "C:/APPS/web2py/applications/jpolie/controllers/default.py",
line 20, in m202
    thisprodj=db(db.prodj.id==request.args[0]).select()[0]
IndexError: list index out of range

will work if manually specify prodj.id in controller, so args are not
being passed from module 201 to controller m202. not sure why??

Any feedback appreciated.
regards
Chrism



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to