I think I see the answer. It seems that if you define a method you get
the form fields, if you don't define a method and default to index you
don't get the fields from the form. i guess there is some logic to
that?
The method below gives me the result I expected
def trans_search(self,*args,**kw):
st =''
for k in kw.keys():
st = '%s kw: %s %s' % (st,k,kw[k])
return '<h1>Transjob %s</h1>' % st
John Bradbury
On 12 Sep, 18:30, johnbraduk <[EMAIL PROTECTED]> wrote:
> I have basically copied the example of subcontrollers from the TG
> book. I am trying to obtain the form fields in the subcontroller,
> but I only get the query values from the calling url, none of the
> input fields on the form. What am I doing wrong?
>
> Snippets from the root controller
>
> from subcontrollers.transjob import JobsTransController
> transjob = JobsTransController()
>
> Below are my attempts to retrieve the POSTED form values in the
> subcontroller.
>
> import turbogears as tg
> import cherrypy
> from turbogears import identity, validators,controllers
> from myei2.model import JobsTrans
> class JobsTransController(controllers.Controller):
> require = identity.not_anonymous()
> @tg.expose(template="myei2.templates.transjob1")
> def index(self,*args,**kw):
> st =''
> for p in cherrypy.request.original_params.keys():
> st = '%s params %s' % (st,p)
>
> for a in args:
> st = '%s args: %s %s' % (st,a,args[a])
>
> for k in kw.keys():
> st = '%s kw: %s %s' % (st,k,kw[k])
> return '<h1>Transjob %s</h1>' % st
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---