Hi all,
I get the following weird behavior. I defined a common_fields, being
request_tenant as such:
db._common_fields.append(Field('request_tenant',default=session.table_token,writable=False))
session.table_token is a uuid generated by the controller.
There I have the following code:
session.table_token = generate_table_token()
if db(db.table).isempty():
field_name = 'MyField'
db.table.insert(name=field_name)
populate(db.table2,100)
But for some reason it won't take the default value for request_tenant the
first time. When I reload the page it creates new entriees with the session
variable correct this time.
I suppose session.table_token does not get evaluated when I first generate
it, so how can I get the requested behavior? (Both with populate and insert)
Thanks a million for your help,
Tsvi