[Zope3-Users] Infinite recursion when storing FieldProperties in
	as annotations (using IAttributeAnnotations).
    Stephan Richter 
    srichter at cosmos.phy.tufts.edu
       
    Mon Aug 29 10:32:08 EDT 2005
    
    
  
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
    
    
More information about the Zope3-users
mailing list