[Zope-dev] SVN: z3c.form/trunk/ ``GroupForm`` and ``Group`` now use ``getContent`` method when instantiating group classes instead of directly accessing ``self.context``, as this is the usual way to access the context of the form and allows nested groups to have a different context than the main form.
    Laurent Mignon 
    laurent.mignon at softwareag.com
       
    Wed Jan 20 02:55:12 EST 2010
    
    
  
On Tue, 2010-01-19 at 15:33 -0500, Stephan Richter wrote:
> On Tuesday 19 January 2010, Michael Howitz wrote:
> > >>> class AddressGroup(group.Group):
> > >>>    label = 'Address'
> > >>>    fields = field.Fields(zope.schema.TextLine(
> > >>>            __name__ = 'owner',
> > >>>            title='Owner',
> > >>>            readOnly=True)
> > >>>    fields += field.Fields(IAddress).select('street')
> > >>> 
> > >>>    def getContext(self):
> > >>
> > >> 
> > >> Should be "getContent", I think.
> > 
> Yes, probably a typo. the context is already exposed publically via the 
> context attribute, while the content is generally a lookup.
> 
Yes it's a typo, sorry...
sagblmi
> Regards,
> Stephan
    
    
More information about the Zope-Dev
mailing list