Repost <http://stackoverflow.com/q/17901525/2626200>.

I can't solve problem with SQLFORM update. I need to compute some field 
(`field_gen`), and be sure, that form filled by an user will be inserted in 
the same record. This form; 


form = SQLFORM(db.tab1, \
                fields=['field1','field_gen'], \
                )

works fine, but this;



    f1 = db.tab1.insert(field_gen='something')
    form = SQLFORM(db.tab1,record=db.tab1(f1),showid=False, \
                fields=['field1','field_gen'], \
                )

can't be accepted by:

form.process().accepted


I get:

form.errors -> <Storage {}>


It is probably similar problem, but with 
CRUD<http://stackoverflow.com/questions/14553594/web2py-custom-forms-are-not-being-submitted>,
 
but I already use SQLFORM...

Also according to web2py 
manual<http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-and-insert/update/delete>it
 should work... I think. My example is part of some slightly bigger web 
application developed for GAE, so maybe the problem is in some other 
part... but where to look for it???

Table definition is:


db.define_table('tab1',
                    Field('field1','string'),
                    Field('field_gen','string'))

   
Changes with parameters `writable` and `readable` doesn't change anything...
Using of `default` or `compute` is also impossible, because `field_gen` 
have to be calculated based some parameters of current session and already 
existed `field_gen` records.

I suppose, that such behavior can be obtained in some other ways, but the 
proposed one seems to be the shortest and easiest... and according to the 
manual<http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-and-insert/update/delete>...
 
should work...

Thank you in advance for your help.

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to