On 8/29/05, Stephan Richter <[EMAIL PROTECTED]> wrote: > On Monday 29 August 2005 10:07, Alec Munro wrote: > > def __setattr__(self, name, obj): > > if self.mapping.has_key(name): > > IDemographicInfo[name].validate(obj) > > self.mapping[name] = obj > > def __getattr__(self, name): > > if self.mapping.has_key(name): > > return self.mapping[name] > > This looks correct, except that you want to bind the field before validation. > > bound = IDemographic[name].bind(self.context) > bound.validate(obj) > > Regards, > Stephan > -- > Stephan Richter > CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) > Web2k - Web Software Design, Development and Training > Thanks, it seemed to work, once I realized that I was creating another infinite recursion when it accessed self.mapping. Also, apparently __getattr__ is actually __getattribute__. I'll do a little more experimentation, but I think it I've got what I need.
Thanks again, Alec _______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users