What is the syntax for having countryName appear in place of
countryTelephoneCode using the represent feature?
Notice in the above situation that countryTelephoneCode is not the primary
key of the Country table.
db.define_table('Party', ## super-type for people and organizations
Field('partyTypeID','reference PartyType'),
Field('displayName','string'))
db.define_table('Country',
Field('countryName','string'),
Field('countryCode','string'),
Field('countryTelephoneCode','integer'))
db.define_table('PartyPhoneNumberIntersection',
Field('partyID','reference Party'),
Field('countryTelephoneCode','integer'),
Field('telephoneNumber','integer'))
db.PartyPhoneNumberIntersection.countryTelephoneCode.represent = lambda id,
row: db.Country(countryTelephoneCode).countryName ## this generates an
error: "global name 'countryTelephoneCode' is not defined"
Thanks,
Alex Glaros
--
---
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.