I think the issue is that people want to do form=SQLFORM(db.table) if form.accepts(...,dbio=False): db.table.insert(**form.vars)
This works always except if form.vars.name is an upload field. In that case the correct value is in form.vars.name_newfilename instead of where people expect it to be. Massimo On Apr 11, 3:36 pm, Yarko Tymciurak <resultsinsoftw...@gmail.com> wrote: > I am not clear - what is the problem this is supposed to be solving? > > What is the expected behavior? > What is the actual behavior? > > If there is a problem, are there other ways to deal with the problem? > > - Yarko > > On Apr 11, 3:09 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > hmmmm... somehody my answer was not posted, reposting it > > > Hi Hamdy, > > > you raise a good issue. I am forwarding to the list to see what people > > think about this in respect to backward compatibility. > > > Eight now when > > > form=SQLFORM(db.define_table('sometable',Field('somefield','upload'))) > > form.accepts(request.vars) > > > request.vars.somefield and form.somefield, both contain a > > cgi.FieldStorage object > > form.somefield_newfieldname contains the new name for the uploaded > > field. > > > Hamdy is proposing changing this so that > > > request.vars.somefield contains the cgi.FieldStorage object and > > and form.somefield and form.somefield_newfieldname, both contain the > > new name for the uploaded field. > > > One the one side the proposed change may simplify the handling on the > > form in some cases. like when dbio=False, bot on the other side it > > introduces some problems: 1) may break backward compatibility > > (although in about something not well documented); 2) even if SQLFORM > > extends a FORM makes them behave differently in respect to how they > > handle type='file' input fields > > > Both 1 and 2 are weak arguments and I am very unsure about this one. > > > Anybody else pro or opposed? > > > Massimo > > > On Apr 11, 2:42 pm, "hamdy.a.farag" <hamdy.a.fa...@inbox.com> wrote: > > > > sorry for the adds , I don't use may mail usually to post in the > > > group -- To unsubscribe, reply using "remove me" as the subject.