when you process a form, request.vars holds the POSTed values of the form. 
What you're experiencing is that fk_id is yet in request.vars because it's 
a var originated by the GET of the page holding the form. Either you use a 
different variable in the GET request (e.g. 
/app/controller/function?whatever=1) and use db.table.fk_id.default = 
request.vars.whatever or you treat the [1,1] as 1 before it's submitted to 
the db.
Generally speaking changing the GET var name is the "recommended" way.

On Thursday, March 7, 2013 4:56:13 PM UTC+1, Richard wrote:
>
> Hello,
>
> Here my problem I want to pass field default form value by the url to like 
> this :
>
> http://127.0.0.1:8000/appname/controller/func?fk_id=1
>
> Then in controller I do :
>
> db.table.fk_id.default=request.vars.fk_id
> ...
> if form.accepts(request.vars, session):
>     # HERE IT FAILED BECAUSE form.vars.fk_id = to ['1', '1'] instead of 
> just '1'
>
> Since form.accepts request.vars, then form.vars.fk_id get value from the 
> form field and the url vars that I pass...
>
> What the proper way to avoid that??
>
> Should I use an other variable name in my URL??
>
> I get this behavior in web2py 2.3.2 in case there is a issue there...
>
> Richard
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to