When I do an insert the computed values dont update....thoughts?

def storage_form_controller():
    x = request.vars.client
    sl_dict = {  'client':request.vars.client,
                 'kind': request.vars.kind,
                 'others_with_access': request.vars.others_with_access,
                 'bank_name_address': request.vars.bank_name_address,
                 'date_surrender_or_trans': 
request.vars.date_surrender_or_trans,
                                    }
    for a in range(0,5):
        try:
            sl_dict.update({'contents_%s' %str(a+1): 
request.vars.contents[a]})
        except:
            pass
    
    ret = db.storage_lockers.validate_and_insert(**sl_dict)



db.define_table('storage_lockers',
    Field('client' , requires=IS_IN_DB(db, db.client.id), writable=False),
    Field('kind', requires=IS_IN_SET(LOCKER)),
    Field('others_with_access', 'string', length=100),
    Field('bank_name_address', 'string', length=100),
    Field('contents_1', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
    Field('contents_2', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
    Field('contents_3', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
    Field('contents_4', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
    Field('contents_5', requires=IS_NULL_OR(IS_IN_DB(db, db.asset.id, 
'%(Additional_Description)s'))),
    Field('date_surrender_or_trans', 'string', length=100),
    Field('content_string', compute=lambda r: storage_string(r)),
               )

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to