Re: [Zope-dev] calling DTML method from python script in Zope
On Sun, 2003-11-23 at 22:59, [EMAIL PROTECTED] wrote: of course I looked over at ZopeLabs; http://www.zopelabs.com/cookbook/992031125 and while this shed some light on the situtation, it hardly solved the problem. the script calls a DTML method in the same folder from which it resides was called from When calling a DTML method from Python, you need to pass in the arguments it expects: def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): While the declaration makes the arguments optional, the template won't be able to bind names unless you pass them. In your case, I would try: dtml = container.your_template_name_here req = context.REQUEST return dtml( container, req, req['RESPONSE'] ) Tres. -- === Tres Seaver[EMAIL PROTECTED] Zope Corporation Zope Dealers http://www.zope.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] calling DTML method from python script in Zope
Hm, I would hope that the Zope book answers this kind of questions, see: http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.stx search for Calling DTML from Scripts This should solve your problem -- please leave a comment if it doesn't. Thanks, peter. [EMAIL PROTECTED] wrote: of course I looked over at ZopeLabs; http://www.zopelabs.com/cookbook/992031125 and while this shed some light on the situtation, it hardly solved the problem. the script calls a DTML method in the same folder from which it resides was called from -thanks in advance -josh ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope ) smime.p7s Description: S/MIME Cryptographic Signature ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] New-style ExtensionClass, ZODB 3.3, and Zope 2.8 status
Dieter Maurer wrote: Jim Fulton wrote at 2003-11-22 12:14 -0500: ... Also note that I had to get rid of the validateValue call. It's important that we always pass the name and container to code that needs to get roles. We need name and container only for objects that do not have their own __roles__ attribute. This essientially means for the newly implemented methods. But, for bound methods, we can determine name and container from the objects. We can determine the container, but we can't reliably the name: class Foo: ...def eeek(self): pass ...oook = eeek Foo().oook.__name__ 'eeek' I would therefore keep validateValue and try to determine container and name. No can do. I'll note that validateValue is hardly every used, at least in the Zope CVS. We really *do* need to refactor this stuff. What we're doing now is a stop-gap measure. Before releasing 2.8, I want to try to design what we want in 2.9 and have 2.8 include warnings and other guidence that will help people get ready for 2.9. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: New-style ExtensionClasses (Zope 2.8) -- MRO issue
Sidnei da Silva wrote: I'm going to fix those (after my english class) and then try something harder ;) Here is more stuff: import mrohell base = mrohell.step1() mrohell.step2(base, mroonly=True) Couldn't get mro for Products.Archetypes.BaseBTreeFolder.BaseBTreeFolder Couldn't get mro for Products.Archetypes.BaseFolder.BaseFolder Couldn't get mro for Products.Archetypes.OrderedBaseFolder.OrderedBaseFolder Couldn't get mro for Products.GroupUserFolder.GroupUserFolder.GroupUserFolder Couldn't get mro for Products.CMFPlone.PloneFolder.BasePloneFolder Couldn't get mro for Products.CMFPlone.LargePloneFolder.LargePloneFolder Couldn't get mro for Products.Archetypes.BaseFolder.BaseFolderMixin Couldn't get mro for Products.CMFDefault.SkinnedFolder.SkinnedFolder Couldn't get mro for Products.CMFPlone.PloneFolder.PloneFolder Couldn't get mro for Products.Archetypes.ArchetypeTool.ArchetypeTool Couldn't get mro for Products.CMFFormController.Script.FSPythonScript Couldn't get mro for Products.CMFFormController.FSControllerValidator.FSControllerValidator Couldn't get mro for Products.CMFCore.FSPythonScript.FSPythonScript Couldn't get mro for Products.CMFFormController.FSControllerPythonScript.FSControllerPythonScript Couldn't get mro for Products.CMFCore.FSPageTemplate.FSPageTemplate Couldn't get mro for Products.CMFFormController.FSControllerPageTemplate.FSControllerPageTemplate Couldn't get mro for Products.CMFPlone.PropertiesTool.PropertiesTool Couldn't get mro for Products.CMFCore.FSZSQLMethod.FSZSQLMethod Couldn't get mro for Products.CMFPlone.FactoryTool.TempFolder Couldn't get mro for Products.Archetypes.OrderedBaseFolder.OrderedFolder Couldn't get mro for Products.Archetypes.examples.SimpleFolder.SimpleFolder 526 21 210 It seems that there are only several classes that cause problems: Products.CMFDefault.SkinnedFolder.SkinnedFolder Products.Archetypes.BaseFolder.BaseFolder Products.CMFCore.FS* Products.Archetypes.BaseFolder.BaseFolderMixin AFAIK most of the other classes with mro problems are just subclasses of these classes above. Christian ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Zope 2.7 b3 problem with reindexing catalog
robert wrote at 2003-11-24 05:32 +0100: ... Traceback (innermost last): * Module ZPublisher.Publish, line 100, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 40, in call_object * Module Products.ZCatalog.ZCatalog, line 474, in manage_reindexIndex * Module Products.ZCatalog.ZCatalog, line 459, in reindexIndex TypeError: catalog_object() got an unexpected keyword argument 'update_metadata' update_metadata is a new keyword argument introduced recently (to fix a bug in Zope 2.6.2). Apparently, you have hit a bug in ZCatalog: While reindexIndex already uses the new argument, catalog_object does not yet support it. -- Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: New-style ExtensionClasses (Zope 2.8) -- MRO issue
On Mon, 2003-11-24 at 13:22, Sidnei da Silva wrote: I think it was decided for the non-mro approach, though no one stated it clearly. If it was, they sure didn't. A summary of the opinions that lead to the decision would be nice. Even if it's decided, it wouldn't hurt to fix the inheritance problems in CMF. One of the key properties of C3 is local order is honored. If a class A has two base classes B and C, then a method defined in B and C (perhaps via their base classes) will be found in B first. This matches the way I think about inheritance, but not the way the old algorithm works. You may be able to change the inheritance hierarchy so that C3 and classic MROs both have the same results. Then programmers will be able to understand the code :-). Jeremy ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: New-style ExtensionClasses (Zope 2.8) -- MRO issue
On Mon, 24 Nov 2003 14:06:07 -0500 Jeremy Hylton [EMAIL PROTECTED] wrote: [snip] Then programmers will be able to understand the code :-). Very interesting conclusion... I might argue that it would be a premature optimization however ;^) -Casey ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] session concurrency
Hi all, I've a product, http://zetadb.sourceforge.net, that uses SESSION extensively. I've just discover, unhappiness, that there are some problems when SESSION object is changed at the same time in two diferent python scripts (using frames). The two frames are changing diferent keys of the SESSION object, but at the end the whole SESSION object is saved, I think, so one of the two objects losses its SESSION data Anybody knows any workarround about this? Thanks in advance Santi Camps ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )