[Zope-dev] Blueprint: zope.generations

Michael Howitz mh at gocept.com
Tue Aug 24 02:32:43 EDT 2010


Am 23.08.2010 um 15:52 schrieb Jim Fulton:
> On Mon, Aug 23, 2010 at 3:41 AM, Michael Howitz <mh at gocept.com> wrote:
[...]
>> The "database opened" event from zope.processlifetime is already used, zope.app.publication is needed for this function in zope.app.generations.utility:
>> 
>> def getRootFolder(context):
>>    return context.connection.root().get(
>>        zope.app.publication.zopepublication.ZopePublication.root_name, None)
>> 
>> I think this function is needed in every generation script.
> 
> Hm, this depends on a particular application (as defined by zope.app).
> 
>> Is there another way to get the root folder?
> 
> Some apps probably don't use a root folder.

But most apps do so, I think. I moved the getRootFolder function to zope.app.generations from zope.app.zopeappgenerations some months ago as it was the only reason I needed the zope.app.zopeappgenerations package.

What about a condition? Only when zope.app.publication is available, the function gets defined. So we could get rid of it as a dependency and do not need a separate package for this function.


>> Should the root_name be hard coded here instead of importing it?
> 
> I think this is an issue for the individual zope.generations plug ins.
> Does zope.generations itself use this?

No it does not use it itself.


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