Hi, I want to compute a field based on the value of another field, which is
a foreign key, in a way similar to:
db.define_table('language',
Field('language', 'string', required = True, unique = True, length = 64
),
format='%(language)s'
)
db.define_table('problemsHere',
Field('language', 'reference language', required = True, unique = False
),
Field('otherField', 'integer'),
Field('computedField',
length=32,
unique=True,
writable=False,
readable=False,
compute=lambda row: db.language(row['language']).
language)
)
I've tried both syntaxes from this similar
question<https://groups.google.com/forum/?fromgroups#!topic/web2py/x53LPKqRpgI>but
none of them seems to work for me. The computedField is always set to
"None".
Does anybody knows a way to access a foreign key in a computed field,
solving my problem?
Thank you in advance,
~Matteo
--
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.