There I was, toying with the idea of writing a simple family checkbook app using ZODB and wxPython. I discover a lacking feature in wxGrid, so I go to www.wxpython.org to see if there's a new version out. Sure enough, there is. Then I look at the wxPython archive to see if anyone had had the same problem. A mention of "Boa Constructor", hmm. I visit the site. Great screenshots, small archive. I download it. While downloading, I think, "wouldn't it be neat if I could access Zope through such a nice IDE?" That was when I realized that Christmas is coming early this year!! http://boa-constructor.sourceforge.net/ http://boa-constructor.sourceforge.net/Screenshots/ZopeExplorer.png Don't let the "0.0.4" version number scare you away. This project is in great shape IMHO. According to Riaan, the author: "...yes, the version is a bit misleading. One reason I've kept it low is that the project is technically not in alpha yet. As I understand it alpha is supposed to be feature complete and there are still a few I want to cram in. Expect the version to jump when we get to alpha." Shane
Hi, I'm using then the INSTANCE_HOME to have separate Zope instances use a base zope installation and a shared products directory with symlink's to the instance product folder. As described in the "How-To: Make your life easier with INSTANCE_HOME" by 4am. Now the LoginManager can't import anything from the ZPattern module. <start up error message> 2000-10-17T21:59:14 ERROR(200) Zope Couldn't import Products.LoginManager Traceback (innermost last): File /bigshare/zopeservers/Zope-2.2.2-base/lib/python/OFS/Application.py, line 397, in import_products (Object: string) File /bigshare/zopeservers/unitedrings/Products/LoginManager/__init__.py, line 1, in ? File /bigshare/zopeservers/unitedrings/Products/LoginManager/LoginManager.py, line 9, in ? ImportError: cannot import name SheetProviderContainer </start up error message> Now this works fine if I start Zope from the base Zope installation. So what goes wrong and why? Does I do anything wrong or should/could this be fixed in the product? If so I guess it would be practical to document som product author guidelines. Regards, Johan Carlsson
Using the following Rule: WHEN eventspec STORE myattributelist USING storemyattributes() SAVING momentolist How does failure to store an attribute get signaled back to the DataSkin? Can I raise an exception in a SkinScript if a rule fails due to failure of the "WHEN eventspec"? What I really is after is a way to control the change of states. To enter one state (changing some attributes to some state) the object needs to be in a precondition state (having some attributes set to some values). The rule should fire when the state attributes are changed, check the precondition and if true, change the state (the attributes) and if not notify the caller (raise exception). Regards, Johan Carlsson
At 12:27 PM 10/18/00 +0100, Johan Carlsson wrote:
Using the following Rule:
WHEN eventspec STORE myattributelist USING storemyattributes() SAVING
momentolist
How does failure to store an attribute get signaled back to the DataSkin?
It does not. An exception in your rule will simply cause the Zope transaction to abort.
Can I raise an exception in a SkinScript if a rule fails due to failure of the "WHEN eventspec"?
No. If the eventspec is not matched, the rule will not fire, so you will not have any opportunity to raise an exception.
What I really is after is a way to control the change of states.
To enter one state (changing some attributes to some state) the object needs to be in a precondition state (having some attributes set to some values). The rule should fire when the state attributes are changed, check the precondition and if true, change the state (the attributes) and if not notify the caller (raise exception).
Rules only fire at transaction or subtransaction commit, so you can only perform your checks at that time. You can perform whatever operations you wish, but only at that point. If you need to force rules to be checked, you must ask Zope to do a subtransaction commit, and then you will be able to catch errors like this: try: get_transaction().commit(1) #subtransaction commit except MyException: # do whatever else: # we're okay, go ahead Note, however, that if you find yourself doing this kind of thing a lot, it's a good sign that your class is missing validation that belongs in the class. If you need the validation to be parameterized or customizable, you can always determine certain class attributes using attribute providers, and thus avoid forcing the existence of complex triggers. In general, triggers are intended to be used as add-ons for data manipulation or to extend a class which otherwise would be difficult to extend. They're not for performing the normal logic of a class.
They're here! http://www.zope.org/Members/pje/ZPatterns/ http://www.zope.org/Members/tsarna/LoginManager/ Note that LoginManager now *includes* a current ZPatterns release, so if you plan to use LoginManager, it's all you need to download. Also, the ZPatterns "PlugIns" product is now available as a seperate release at: http://www.zope.org/Members/pje/PlugIns/ But it is also bundled into the ZPatterns and LoginManager releases, so you don't need to download it unless you intend to use the PlugIns package as a standalone. Some feature highlights: ZPatterns 0.4.3b1: * SkinScript methods with new features and docs * ClassExtenders * Full transaction/sub-transaction support * Specialist and Rack can be subclassed as ZClasses (thanks to the new PlugIns) * Cleaner help files in Zope help system PlugIns 0.4.3b1: * Basic support for extending PlugIns and PlugInContainers with ZClasses LoginManager 0.8.8b1: * UserSource is now subclassable as a ZClass (thanks to the new PlugIns) * Extended "access" file support (see dev.zope.org proposal) * Hot-fix patches to support computed local roles * Support for secure cookies * Ownership fixes for 2.2.x Please note that Ty and I have not yet gotten around to back-porting the contributed support for Zope's built-in local roles interface. We are thinking instead about adding a hotfix to LM to fix what we consider to be a broken interface in Zope, actually.
participants (3)
-
Johan Carlsson -
Phillip J. Eby -
Shane Hathaway