[Product-Developers] passing variable definitions and accessing schema fields
John DeStefano
john.destefano at gmail.com
Tue Jul 8 15:01:05 UTC 2008
How would one get the value of a subscriber variable in the
DisplayList vocabulary of a custom type schema? For instance, I have
the following code in a subscriber to get a member's email address,
but I need to pull it from there and/or pass the value to a custom
InAndOutWidget field for creating an email list:
# get member's email address:
from Products.CMFCore.utils import getToolByName
mymemberinfo=getToolByName(obj,'portal_membership')
mymember=mymemberinfo.getAuthenticatedMember()
mymail=mymember.getProperty('email')
How would I pass the value of $mymail to my vocabulary=DisplayList?
Or incorporate this instead into the schema definition?
I would also like to re-use the date (startDate and endDate?) fields
and mail text field (text?) of the Event schema in a custom type, but
I can't figure out how to use accessor methods to access their
content. I'm not even sure that startDate, endDate, and text are the
proper field names: though they appear to be so in the ATEvent schema
code, trying to access these names (with 'accessor=') results in
attribute errors.
More information about the Product-Developers
mailing list