Hash: SHA1

Dieter Maurer wrote:
| Paolo Bizzarri wrote at 2004-8-10 09:44 +0200:
|>from Products.TemporaryFolder.TemporaryFolder import
|>def manage_addMyFolderCache(container, id, title='')
|>   mfc = MyFolderCache(id, title)
|>   container._setObject(id, mfc)
| The standard way is:
|     destination.manage_addProduct[product_name].constructor(...).

This is part of the problem, but I don't thik is the whole problem.

Please take time to review the example I'm including in this mail. You
can find the TFProduct, which creates a Folderish object, puts a
temporary folder named alfa inside it, and then another folder called
cache inside alfa temporary folder.

Note that in order to create a TFProduct you've to pass the id argument
on the URL...

As you can see, I'm using all manage_addProduct calls. However, when I
review the result from the ZMI (or whatever) you end up with:

~ |
~ +- alfa
~ |
~ +- cache

instead of:

+- alfa
~    |
~    +- cache

which is what I wanted.

| When you follow the standard way, you avoid FMEs (Frequently Made Errors) | such as the above: "mfc" is not acquisition wrapped!

Shame on *me* for doing a FME and posting on the list :).

However, it is also the way to really undestand why things have to be
done that way.

|>2) how can I do what I want to do in a single transaction?
| I fear you will need your own MountPoint logic that
| does not depend an preconfigured storages in Zope's configuration
| file.

I don't think so. You can add a temporary folder wherever you want in a
Zope installation without any configuration.

Also, I'm using Zope 2.6.4, which has not any configuration for the
storage (no DBTab here).

Thanks for your support.
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


Attachment: TFProduct.tgz
Description: GNU Unix tar archive

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to