[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.

Michael Howitz mh at gocept.com
Wed Jan 20 02:54:45 EST 2010


Am 19.01.2010 um 21:30 schrieb Stephan Richter:

> On Tuesday 19 January 2010, Michael Howitz wrote:
>>> My understand of ``getContent`` is to provide a way to give values used 
>>> by the widgets. By default, since the common use case is to edit / 
>>> display values from the context, the implementation return the context.
>> 
>> I see it differently. So I'd like to ask what was the original intention of
>> ``getContent``?  Anyone here to answer this question?
> 
> Originally we only supported the context to be modified. We later found this 
> far too limiting as a form should be able to modify any sort of objects within 
> a context or not caring about the context at all.
> 
> "getContent()" can return anything it wants to as long as a data manager can 
> map the fields to it. So I think Laurent is correct.

Okay, then I'll revert my changes and make a new release.


Yours sincerely,
-- 
Michael Howitz · mh at gocept.com · software developer
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1
Zope and Plone consulting and development



More information about the Zope-Dev mailing list