. I created a simple app, with only this in it,
. I can get computed field to work , but never referencing the id field.
I think the trouble is that 'id' is never updated, so it is not available
for compute= .
I don't think I can do this when the record is first created, since an 'id'
has not been assigned.
I want to eventually add another field that depends on 'id' that is why I'm
doing this.
I could use a virtual field I think...
Thanks
Rob
## after auth = Auth(db)
auth.settings.extra_fields['auth_user']= [
Field('address'),
Field('city'),
Field('zip'),
Field('phone'),
Field('ref_number', compute=lambda r: r['city'])]
# this WORKS
# Field('ref_number', compute=lambda r: r['city'])]
# this DOES NOT WORK
# Field('ref_number', compute=lambda r: r['id'])]
# Field('ref_number', 'integer', compute=lambda r: r['id'])]
# before auth.define_tables(username=True)
## create all tables needed by auth if not custom tables
auth.define_tables()
--