From pw_lists at slinkp.com Sun Oct 1 18:22:10 2006 From: pw_lists at slinkp.com (Paul Winkler) Date: Sun, 1 Oct 2006 12:22:10 -0400 Subject: [z3-five] [Zope] Re: A Quick Event-based Cataloging How-to for Zope 2 In-Reply-To: <451D9CF3.4010707@simplistix.co.uk> References: <451949AF.7050005@simplistix.co.uk> <451D9CF3.4010707@simplistix.co.uk> Message-ID: <20061001162210.GJ7408@slinkp.com> On Fri, Sep 29, 2006 at 11:23:47PM +0100, Chris Withers wrote: > whit wrote: > >thanks Chris! > > > >-w > > I just wish there was a good and more permenant place to put this... maybe zopewiki.org? thanks for the writeup, very useful and readable! -- Paul Winkler http://www.slinkp.com From y.2006_ at wcm-solutions.de Sun Oct 1 21:30:23 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sun, 01 Oct 2006 21:30:23 +0200 Subject: [z3-five] propagating form/formlib fixes Message-ID: <4520174F.6080900@wcm-solutions.de> Hi! Zope 2.9.5 will ship with some form and formlib fixes backported from Zope 3.3. I'd like to make sure the related code in Five 1.4 and 1.5 is up to date. A few questions: - Is it fine to limit this to Five 1.4 and 1.5? I don't think many people use zope.app.form with older Five versions, formlib support is anyway new in Five 1.4. - Is it fine to make Zope 2.9.5 required for the next Five 1.4 release? - Five ships with its own version of pageform.pt and subpageform.pt. AFAICS that's only necessary in Five 1.4 for pageform.pt because the original version uses metal:extend-macro and metal:define-macro in the same tag. I propose to sync Five 1.4's pageform.pt as far as possible with Zope 3.2.2 and to remove all other copies of pageform.pt and subpageform.pt. ZopeTwoPageTemplateFiles can be created directly from the zope.formlib versions. Any comments? Cheers, Yuppie From maciej.wisniowski at coig.katowice.pl Sun Oct 1 23:30:26 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Sun, 01 Oct 2006 23:30:26 +0200 Subject: [z3-five] propagating form/formlib fixes In-Reply-To: <4520174F.6080900@wcm-solutions.de> References: <4520174F.6080900@wcm-solutions.de> Message-ID: <45203372.3010608@coig.katowice.pl> >Any comments? > > I'm using 2.9.4 with Five 1.4 and formlib. Having Zope 2.9.5 required for next Five 1.4 release seems to be acceptable for me. Maybe it is good moment to do something with DateDisplayWidget? I mean - remove reference to 'request.locale' from it's code. There was a long thread about this on Zope list and I've even send proposal of modified code there. -- Maciej Wisniowski From chris at simplistix.co.uk Mon Oct 2 13:18:48 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Mon, 02 Oct 2006 12:18:48 +0100 Subject: [z3-five] A Quick Event-based Cataloging How-to for Zope 2 In-Reply-To: <319e029f0609300023q353a22f2kf7c77b986702e533@mail.gmail.com> References: <451949AF.7050005@simplistix.co.uk> <319e029f0609260907pa075d86w81c782d57d6ee115@mail.gmail.com> <451950DC.3050602@simplistix.co.uk> <319e029f0609300023q353a22f2kf7c77b986702e533@mail.gmail.com> Message-ID: <4520F598.9010000@simplistix.co.uk> Good plan: http://zopewiki.org/Zope2EventBasedCataloging I hope the gods of ZWiki will link it into the right places... Chris Lennart Regebro wrote: > http://zopewiki.org/ZopeWiki ? -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From restless.being at gmail.com Mon Oct 2 14:53:39 2006 From: restless.being at gmail.com (eXt) Date: Mon, 2 Oct 2006 14:53:39 +0200 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors Message-ID: <200610021453.39260.restless.being@gmail.com> Hi I installed Zope 2.10.0.c1 on my Kubuntu Dapper (also tried Fedora 4) set 'default-zpublisher-encoding' to 'utf-8' at zope.conf and... ecountered a UnicodeDecodeError while trying to use a view page template containing international characters (utf-8). It's very easy to reproduce my problem - just put ViewsTutorial (from Five docs/products directory) to zope instance's Producs folder, and add unicode characters to 'someview.pt', restart Zope, create Five Demo Content instance via ZMI and view it. Exactly the same code worked well at Zope 2.9.4. Some meaningful code below: someview.pt: ?abka (text with national characters) configure.zcml: Full traceback is: Traceback (innermost last): * Module ZPublisher.Publish, line 115, in publish * Module ZPublisher.mapply, line 88, in mapply * Module ZPublisher.Publish, line 41, in call_object * Module Products.Five.browser.metaconfigure, line 404, in __call__ * Module Shared.DC.Scripts.Bindings, line 313, in __call__ * Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec * Module Products.PageTemplates.PageTemplateFile, line 121, in _exec * Module Products.PageTemplates.PageTemplate, line 89, in pt_render * Module zope.pagetemplate.pagetemplate, line 118, in pt_render Warning: Macro expansion failed Warning: exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 14: ordinal not in range(128) * Module StringIO, line 271, in getvalue UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 14: ordinal not in range(128) What is going on? -- Jakub Wisniowski From chris at simplistix.co.uk Mon Oct 2 16:19:37 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Mon, 02 Oct 2006 15:19:37 +0100 Subject: [z3-five] [Zope] Re: A Quick Event-based Cataloging How-to for Zope 2 In-Reply-To: <20061001162210.GJ7408@slinkp.com> References: <451949AF.7050005@simplistix.co.uk> <451D9CF3.4010707@simplistix.co.uk> <20061001162210.GJ7408@slinkp.com> Message-ID: <45211FF9.3090004@simplistix.co.uk> Paul Winkler wrote: > maybe zopewiki.org? > > thanks for the writeup, very useful and readable! Yeah, I'm trying to get better at writing "dox for stupid people", which is the category I often fall into when I need to do something like this in a hurry or after little sleep... It's also getting perilously close to being a doctest ;-) That said, I'm still shuddering at doing the tests for the Zope 2 components to make Twiddler work *sigh* Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From y.2006_ at wcm-solutions.de Mon Oct 2 16:28:23 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Mon, 02 Oct 2006 16:28:23 +0200 Subject: [z3-five] propagating form/formlib fixes In-Reply-To: <45203372.3010608@coig.katowice.pl> References: <4520174F.6080900@wcm-solutions.de> <45203372.3010608@coig.katowice.pl> Message-ID: <45212207.4000201@wcm-solutions.de> Hi Maciej! Maciej Wisniowski wrote: > Maybe it is good moment to do something with DateDisplayWidget? > I mean - remove reference to 'request.locale' from it's code. > There was a long thread about this on Zope list and I've even send > proposal of modified code there. I'd prefer to make 'request.locale' available. If we can't do that in general because of backwards compatibility issues we should do this at least in browser views. People who want to use browser views modify their code anyway. It should be easy for them to avoid 'locale' form variables. The easiest way would be to attach locale directly to the request: def __init__(self, context, request): self.context = context self.request = request self.request.locale = getLocale(request) A cleaner solution would use a proxy object: def __init__(self, context, request): self.context = context self.request = LocaleProxy(request) Cheers, Yuppie From chris at simplistix.co.uk Tue Oct 3 10:26:40 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Tue, 03 Oct 2006 09:26:40 +0100 Subject: [z3-five] propagating form/formlib fixes In-Reply-To: <45212207.4000201@wcm-solutions.de> References: <4520174F.6080900@wcm-solutions.de> <45203372.3010608@coig.katowice.pl> <45212207.4000201@wcm-solutions.de> Message-ID: <45221EC0.3080003@simplistix.co.uk> yuppie wrote: > I'd prefer to make 'request.locale' available. If we can't do that in > general because of backwards compatibility issues ...we really need to bite the bullet on this some time soon. Yeah, sure, some apps will break. I'll be that it won't be many, and would make life a lot easier for the other 99% of us! cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From sidnei at enfoldsystems.com Wed Oct 4 00:51:13 2006 From: sidnei at enfoldsystems.com (Sidnei da Silva) Date: Tue, 3 Oct 2006 22:51:13 +0000 (UTC) Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors References: <200610021453.39260.restless.being@gmail.com> Message-ID: > What is going on? You should probably send that email to zope-dev at zope.org. Doesn't look like the person involved on the change (Andreas Jung I believe) is subscribed to this list. -- Sidnei da Silva Enfold Systems, Inc From sidnei at enfoldsystems.com Wed Oct 4 00:55:16 2006 From: sidnei at enfoldsystems.com (Sidnei da Silva) Date: Tue, 3 Oct 2006 22:55:16 +0000 (UTC) Subject: [z3-five] Problems with defaultView/defaultViewable and CMF Message-ID: Hi there, I've recently discovered that five:defaultViewable and browser:defaultView do *not* work with CMF 1.6+, due to the fact that DynamicType overrides __before_publishing_traverse___ which prevents __browser_default__ from being called. Questions: - Anyone else has faced this issue? - Would you say this is a Five or CMF bug (or maybe Zope?) bug? -- Sidnei da Silva Enfold Systems, Inc From lists at zopyx.com Wed Oct 4 05:32:39 2006 From: lists at zopyx.com (Andreas Jung) Date: Wed, 04 Oct 2006 05:32:39 +0200 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors In-Reply-To: <200610021453.39260.restless.being@gmail.com> References: <200610021453.39260.restless.being@gmail.com> Message-ID: <7054C9BA2BF7839ACB411CDE@[192.168.0.28]> Possibly a a problem with the new ZPT engine from ZPT. Please put this into the Zope bugtracker (preferred with a *unittest* demonstrating this issue). -aj --On 2. Oktober 2006 14:53:39 +0200 eXt wrote: > Hi > > I installed Zope 2.10.0.c1 on my Kubuntu Dapper (also tried Fedora 4) > set 'default-zpublisher-encoding' to 'utf-8' at zope.conf and... > ecountered a UnicodeDecodeError while trying to use a view page template > containing international characters (utf-8). > > It's very easy to reproduce my problem - just put ViewsTutorial (from > Five docs/products directory) to zope instance's Producs folder, and add > unicode characters to 'someview.pt', restart Zope, create Five Demo > Content instance via ZMI and view it. Exactly the same code worked well > at Zope 2.9.4. > > Some meaningful code below: > > someview.pt: > > > ?abka (text with national characters) > > > > configure.zcml: > for=".democontent.IDemoContent" > name="someview.html" > template="someview.pt" > permission="zope2.ViewManagementScreens" > /> > > > Full traceback is: > Traceback (innermost last): > > * Module ZPublisher.Publish, line 115, in publish > * Module ZPublisher.mapply, line 88, in mapply > * Module ZPublisher.Publish, line 41, in call_object > * Module Products.Five.browser.metaconfigure, line 404, in __call__ > * Module Shared.DC.Scripts.Bindings, line 313, in __call__ > * Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec > * Module Products.PageTemplates.PageTemplateFile, line 121, in _exec > * Module Products.PageTemplates.PageTemplate, line 89, in pt_render > * Module zope.pagetemplate.pagetemplate, line 118, in pt_render > Warning: Macro expansion failed > Warning: exceptions.UnicodeDecodeError: 'ascii' codec can't decode > byte 0xc5 in position 14: ordinal not in range(128) > * Module StringIO, line 271, in getvalue > > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 14: > ordinal not in range(128) > > What is going on? > > > -- > Jakub Wisniowski > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 T?bingen - Germany Web: www.zopyx.com - Email: info at zopyx.com - Phone +49 - 7071 - 793376 E-Publishing, Python, Zope & Plone development, Consulting -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20061004/ea19c2e3/attachment-0001.pgp From chris at simplistix.co.uk Wed Oct 4 09:15:16 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Wed, 04 Oct 2006 08:15:16 +0100 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors In-Reply-To: <7054C9BA2BF7839ACB411CDE@[192.168.0.28]> References: <200610021453.39260.restless.being@gmail.com> <7054C9BA2BF7839ACB411CDE@[192.168.0.28]> Message-ID: <45235F84.7090008@simplistix.co.uk> Andreas Jung wrote: > Possibly a a problem with the new ZPT engine from ZPT. Please put this > into the Zope bugtracker (preferred with a *unittest* demonstrating this > issue). I actually covered these problems in quite a lot of detail in a series of posts to this or the zope at zope.org list a month or three ago. I'd suggest googling for help... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From y.2006_ at wcm-solutions.de Wed Oct 4 10:42:51 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Wed, 04 Oct 2006 10:42:51 +0200 Subject: [z3-five] SVN: Products.Five/branches/1.5/ Tag a release branch for the 1.5 line. In-Reply-To: <20061004021719.DCCC620316E@mail.zope.org> References: <20061004021719.DCCC620316E@mail.zope.org> Message-ID: <4523740B.20602@wcm-solutions.de> Hi! Tres Seaver wrote: > Log message for revision 70512: > Tag a release branch for the 1.5 line. > > > Changed: > A Products.Five/branches/1.5/ > > -=- > Copied: Products.Five/branches/1.5 (from rev 69454, Products.Five/trunk) There are two issues with this checkin: 1.) It is not in line with our current policy: http://codespeak.net/pipermail/z3-five/2006q3/001639.html 2.) The branch was copied from a historical revision, the latest bugfix (r69839) is missing on the branch. I was planning to backport some bugfixes from Zope3 to Five and I can't see a good reason why I should do that twice (1.5 branch *and* trunk). I propose to delete the 1.5 branch. Of course anybody is welcome to create it again from the *latest* trunk revision *if* she wants to add a new feature on the trunk. Cheers, Yuppie From y.2006_ at wcm-solutions.de Wed Oct 4 11:46:44 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Wed, 04 Oct 2006 11:46:44 +0200 Subject: [z3-five] Problems with defaultView/defaultViewable and CMF In-Reply-To: References: Message-ID: <45238304.5040704@wcm-solutions.de> Hi Sidnei! Sidnei da Silva wrote: > I've recently discovered that five:defaultViewable and browser:defaultView > do *not* work with CMF 1.6+, due to the fact that DynamicType overrides > __before_publishing_traverse___ which prevents __browser_default__ from > being called. > > Questions: > > - Anyone else has faced this issue? > - Would you say this is a Five or CMF bug (or maybe Zope?) bug? > I haven't tried that for a long time because I still prefer to use CMF's __before_publishing_traverse__ hook for all default view settings. But IIRC you can use browser:defaultView *if* you don't set a default using DynamicType. Of course the __before_publishing_traverse__ hook in CMF was added 3 years ago, long before browser:defaultView was available in Zope 2. So they compete in some way, but I don't consider this a bug. Cheers, Yuppie From restless.being at gmail.com Wed Oct 4 12:39:28 2006 From: restless.being at gmail.com (eXt) Date: Wed, 4 Oct 2006 12:39:28 +0200 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors In-Reply-To: <45235F84.7090008@simplistix.co.uk> References: <200610021453.39260.restless.being@gmail.com> <7054C9BA2BF7839ACB411CDE@[192.168.0.28]> <45235F84.7090008@simplistix.co.uk> Message-ID: <200610041239.28588.restless.being@gmail.com> Dnia ?roda, 4 pa?dziernika 2006 09:15, Chris Withers napisa?: > I actually covered these problems in quite a lot of detail in a series > of posts to this or the zope at zope.org list a month or three ago. > > I'd suggest googling for help... Do you think about a thread called: 'unicodes and strings in Zope 2.9's ZPT with Zope 3's i18n' dated 2006/07/11? I read it but I think I faced a different problem here. I use Zope 2.10 and very simple PageTemplate that is not dynamic at all. I don't have mixin of different types of strings etc. in it. I just want to put some text with national characters to it and it doesn't work. I submitted an issue: http://www.zope.org/Collectors/Zope/2204, with an unit test attached, as Andreas asked. -- Jakub Wisniowski From rocky at serverzen.com Wed Oct 4 13:17:46 2006 From: rocky at serverzen.com (Rocky Burt) Date: Wed, 04 Oct 2006 08:47:46 -0230 Subject: [z3-five] SVN: Products.Five/branches/1.5/ Tag a release branch for the 1.5 line. In-Reply-To: <4523740B.20602@wcm-solutions.de> References: <20061004021719.DCCC620316E@mail.zope.org> <4523740B.20602@wcm-solutions.de> Message-ID: <1159960662.5753.7.camel@localhost> On Wed, 2006-04-10 at 10:42 +0200, yuppie wrote: > I propose to delete the 1.5 branch. Of course anybody is welcome to > create it again from the *latest* trunk revision *if* she wants to add a > new feature on the trunk. I know a few people seemed to be quite eager to begin work on Five 1.6 functionality (we'll certainly see some development on that during the plone conference sprint). I'd personally feel more comfortable with the branch right now rather than being stuck in a situation where I'd have to create this myself (which I don't feel I'm qualified to do). - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061004/4d1dcbf8/attachment.pgp From lists at zopyx.com Wed Oct 4 13:42:19 2006 From: lists at zopyx.com (Andreas Jung) Date: Wed, 04 Oct 2006 13:42:19 +0200 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors In-Reply-To: <200610041239.28588.restless.being@gmail.com> References: <200610021453.39260.restless.being@gmail.com> <7054C9BA2BF7839ACB411CDE@[192.168.0.28]> <45235F84.7090008@simplistix.co.uk> <200610041239.28588.restless.being@gmail.com> Message-ID: <7C857837ABE34F9FB901E95F@[192.168.0.28]> --On 4. Oktober 2006 12:39:28 +0200 eXt wrote: > > I submitted an issue: http://www.zope.org/Collectors/Zope/2204, with an > unit test attached, as Andreas asked. Is it possible to reproduce this issue w/ Zope 3.3? -aj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20061004/8811b7cd/attachment.pgp From tseaver at palladion.com Wed Oct 4 13:43:17 2006 From: tseaver at palladion.com (Tres Seaver) Date: Wed, 04 Oct 2006 07:43:17 -0400 Subject: [z3-five] SVN: Products.Five/branches/1.5/ Tag a release branch for the 1.5 line. In-Reply-To: <4523740B.20602@wcm-solutions.de> References: <20061004021719.DCCC620316E@mail.zope.org> <4523740B.20602@wcm-solutions.de> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 yuppie wrote: > Hi! > > > Tres Seaver wrote: >> Log message for revision 70512: >> Tag a release branch for the 1.5 line. >> >> Changed: >> A Products.Five/branches/1.5/ >> >> -=- >> Copied: Products.Five/branches/1.5 (from rev 69454, Products.Five/trunk) > > There are two issues with this checkin: > > 1.) It is not in line with our current policy: > http://codespeak.net/pipermail/z3-five/2006q3/001639.html That mail says: As Five 1.2 is now phasing out and we might start development on Five 1.6 (see below), a Five 1.5 branch is to be expected soon. Anyone is welcome to create it in order to lift the current feature freeze on the trunk. > 2.) The branch was copied from a historical revision, the latest bugfix > (r69839) is missing on the branch. The branch was copied from the same revisiton that the 1.5 tag was made from. > I was planning to backport some bugfixes from Zope3 to Five and I can't > see a good reason why I should do that twice (1.5 branch *and* trunk). Because we are supporting 2.10, while still allowing feature development to go forward? > I propose to delete the 1.5 branch. Of course anybody is welcome to > create it again from the *latest* trunk revision *if* she wants to add a > new feature on the trunk. - -1. 1.5 *already shipped* with Zope3, and has known bugs (the one I fixed, for instance). How do you propose that we fix such bugs to support 2.10 without leaving the trunk frozen forever? Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFI55V+gerLs4ltQ4RAn++AJwJHCAFLbj7WqyEvv4QY6ulpizT5ACg1sn/ EuKr6m2ElfprxTqtGJ2gURk= =hbGB -----END PGP SIGNATURE----- From y.2006_ at wcm-solutions.de Wed Oct 4 14:42:53 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Wed, 04 Oct 2006 14:42:53 +0200 Subject: [z3-five] SVN: Products.Five/branches/1.5/ Tag a release branch for the 1.5 line. In-Reply-To: <1159960662.5753.7.camel@localhost> References: <20061004021719.DCCC620316E@mail.zope.org> <4523740B.20602@wcm-solutions.de> <1159960662.5753.7.camel@localhost> Message-ID: <4523AC4D.5090303@wcm-solutions.de> Hi Rocky! Rocky Burt wrote: > On Wed, 2006-04-10 at 10:42 +0200, yuppie wrote: >> I propose to delete the 1.5 branch. Of course anybody is welcome to >> create it again from the *latest* trunk revision *if* she wants to add a >> new feature on the trunk. > > I know a few people seemed to be quite eager to begin work on Five 1.6 > functionality (we'll certainly see some development on that during the > plone conference sprint). > > I'd personally feel more comfortable with the branch right now rather > than being stuck in a situation where I'd have to create this myself > (which I don't feel I'm qualified to do). Well. Tres made it wrong (using an old revision), but in general it is not that hard to create a branch. Anybody who is able to contribute new features should be able to create a release branch. Maybe the policy that anybody is allowed to do so was not announced well enough, but why don't you "feel qualified" based on that policy? Cheers, Yuppie From y.2006_ at wcm-solutions.de Wed Oct 4 14:47:10 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Wed, 04 Oct 2006 14:47:10 +0200 Subject: [z3-five] SVN: Products.Five/branches/1.5/ Tag a release branch for the 1.5 line. In-Reply-To: References: <20061004021719.DCCC620316E@mail.zope.org> <4523740B.20602@wcm-solutions.de> Message-ID: <4523AD4E.300@wcm-solutions.de> Hi! Tres Seaver wrote: > > yuppie wrote: >> >> Tres Seaver wrote: >>> Log message for revision 70512: >>> Tag a release branch for the 1.5 line. >>> >>> Changed: >>> A Products.Five/branches/1.5/ >>> >>> -=- >>> Copied: Products.Five/branches/1.5 (from rev 69454, Products.Five/trunk) >> There are two issues with this checkin: >> >> 1.) It is not in line with our current policy: >> http://codespeak.net/pipermail/z3-five/2006q3/001639.html > > That mail says: > > As Five 1.2 is now phasing out and we might start development on Five > 1.6 (see below), a Five 1.5 branch is to be expected soon. Anyone is > welcome to create it in order to lift the current feature freeze on > the trunk. You are quoting this out of context. Philipp used the trunk because it made maintenance easier - not because creating a branch would have been hard work. Lifting the current feature freeze should not be done just for fun - it should only be done if someone actually wants to check in a new feature. >> 2.) The branch was copied from a historical revision, the latest bugfix >> (r69839) is missing on the branch. > > The branch was copied from the same revisiton that the 1.5 tag was made > from. That mail also says: There currently is no Five 1.5 branch. The trunk is Five 1.5.x. Until the trunk is needed for new features Five 1.5 maintenance is done on the trunk. Delaying branch creation doesn't make any sense if we have to backport all fixes at a later point. It *makes* sense if trunk bugfixes become automatically part of the 1.5 branch by creating it from the *latest* non-feature revision of the trunk. >> I was planning to backport some bugfixes from Zope3 to Five and I can't >> see a good reason why I should do that twice (1.5 branch *and* trunk). > > Because we are supporting 2.10, while still allowing feature development > to go forward? > >> I propose to delete the 1.5 branch. Of course anybody is welcome to >> create it again from the *latest* trunk revision *if* she wants to add a >> new feature on the trunk. > > - -1. 1.5 *already shipped* with Zope3, and has known bugs (the one I > fixed, for instance). How do you propose that we fix such bugs to > support 2.10 without leaving the trunk frozen forever? I think Philipp made clear that new features are welcome at any time - you just have to create the 1.5 branch before checking them in. Cheers, Yuppie From rocky at serverzen.com Wed Oct 4 14:49:23 2006 From: rocky at serverzen.com (Rocky Burt) Date: Wed, 04 Oct 2006 10:19:23 -0230 Subject: [z3-five] SVN: Products.Five/branches/1.5/ Tag a release branch for the 1.5 line. In-Reply-To: <4523AC4D.5090303@wcm-solutions.de> References: <20061004021719.DCCC620316E@mail.zope.org> <4523740B.20602@wcm-solutions.de> <1159960662.5753.7.camel@localhost> <4523AC4D.5090303@wcm-solutions.de> Message-ID: <1159966156.5753.35.camel@localhost> Hi Yuppie! On Wed, 2006-04-10 at 14:42 +0200, yuppie wrote: > Hi Rocky! > > Maybe the policy that anybody is allowed to do so was not announced well > enough, but why don't you "feel qualified" based on that policy? > Because I haven't being keeping up on the release policies... so many projects, so little time.... you know the story :) - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061004/8dc9058f/attachment.pgp From restless.being at gmail.com Wed Oct 4 15:10:39 2006 From: restless.being at gmail.com (eXt) Date: Wed, 4 Oct 2006 15:10:39 +0200 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors In-Reply-To: <7C857837ABE34F9FB901E95F@[192.168.0.28]> References: <200610021453.39260.restless.being@gmail.com> <200610041239.28588.restless.being@gmail.com> <7C857837ABE34F9FB901E95F@[192.168.0.28]> Message-ID: <200610041510.39901.restless.being@gmail.com> Dnia sroda, 4 pazdziernika 2006 13:42, Andreas Jung napisal: > Is it possible to reproduce this issue w/ Zope 3.3? I think problem appears only with Zope 2.10 becaue it uses modified PageTemplate and PageTemplateFile from Products.PageTemplates package (which in turn use PageTemplate and PageTemplateFile from zope.pagetemplate package). Zope 3.3 uses zope.pagetemplate package in a straight way. My tests with the latter package work well. -- Jakub Wisniowski From tseaver at palladion.com Wed Oct 4 17:09:50 2006 From: tseaver at palladion.com (Tres Seaver) Date: Wed, 04 Oct 2006 11:09:50 -0400 Subject: [z3-five] SVN: Products.Five/branches/1.5/ Tag a release branch for the 1.5 line. In-Reply-To: <4523AC4D.5090303@wcm-solutions.de> References: <20061004021719.DCCC620316E@mail.zope.org> <4523740B.20602@wcm-solutions.de> <1159960662.5753.7.camel@localhost> <4523AC4D.5090303@wcm-solutions.de> Message-ID: <4523CEBE.2030106@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 yuppie wrote: > Hi Rocky! > > > Rocky Burt wrote: >> On Wed, 2006-04-10 at 10:42 +0200, yuppie wrote: >>> I propose to delete the 1.5 branch. Of course anybody is welcome to >>> create it again from the *latest* trunk revision *if* she wants to add a >>> new feature on the trunk. >> I know a few people seemed to be quite eager to begin work on Five 1.6 >> functionality (we'll certainly see some development on that during the >> plone conference sprint). >> >> I'd personally feel more comfortable with the branch right now rather >> than being stuck in a situation where I'd have to create this myself >> (which I don't feel I'm qualified to do). > > Well. Tres made it wrong (using an old revision), but in general it is > not that hard to create a branch. Anybody who is able to contribute new > features should be able to create a release branch. I made it *deliberately* to correspond with the released version: that is how our normal branching policy works. Fixes committed since that date need to be backported: I will look at doing that today. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFI86++gerLs4ltQ4RAriFAJ9RTWebV4WX6y5iLvWKJo0GIqS/qQCgkxcs bLrZ+NPfCmhkaChH7Pr5bu0= =X+7h -----END PGP SIGNATURE----- From tseaver at palladion.com Wed Oct 4 17:10:08 2006 From: tseaver at palladion.com (Tres Seaver) Date: Wed, 04 Oct 2006 11:10:08 -0400 Subject: [z3-five] SVN: Products.Five/branches/1.5/ Tag a release branch for the 1.5 line. In-Reply-To: <4523AD4E.300@wcm-solutions.de> References: <20061004021719.DCCC620316E@mail.zope.org> <4523740B.20602@wcm-solutions.de> <4523AD4E.300@wcm-solutions.de> Message-ID: <4523CED0.5030508@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 yuppie wrote: > Hi! > > > Tres Seaver wrote: >> >> yuppie wrote: >>> >>> Tres Seaver wrote: >>>> Log message for revision 70512: >>>> Tag a release branch for the 1.5 line. >>>> >>>> Changed: >>>> A Products.Five/branches/1.5/ >>>> >>>> -=- >>>> Copied: Products.Five/branches/1.5 (from rev 69454, >>>> Products.Five/trunk) >>> There are two issues with this checkin: >>> >>> 1.) It is not in line with our current policy: >>> http://codespeak.net/pipermail/z3-five/2006q3/001639.html >> >> That mail says: >> >> As Five 1.2 is now phasing out and we might start development on Five >> 1.6 (see below), a Five 1.5 branch is to be expected soon. Anyone is >> welcome to create it in order to lift the current feature freeze on >> the trunk. > > You are quoting this out of context. Philipp used the trunk because it > made maintenance easier - not because creating a branch would have been > hard work. Lifting the current feature freeze should not be done just > for fun - it should only be done if someone actually wants to check in a > new feature. > >>> 2.) The branch was copied from a historical revision, the latest bugfix >>> (r69839) is missing on the branch. >> >> The branch was copied from the same revisiton that the 1.5 tag was made >> from. > > That mail also says: > > There currently is no Five 1.5 branch. The trunk is Five 1.5.x. > > Until the trunk is needed for new features Five 1.5 maintenance is done > on the trunk. Delaying branch creation doesn't make any sense if we have > to backport all fixes at a later point. It *makes* sense if trunk > bugfixes become automatically part of the 1.5 branch by creating it from > the *latest* non-feature revision of the trunk. > >>> I was planning to backport some bugfixes from Zope3 to Five and I can't >>> see a good reason why I should do that twice (1.5 branch *and* trunk). >> >> Because we are supporting 2.10, while still allowing feature development >> to go forward? >> >>> I propose to delete the 1.5 branch. Of course anybody is welcome to >>> create it again from the *latest* trunk revision *if* she wants to add a >>> new feature on the trunk. >> >> - -1. 1.5 *already shipped* with Zope3, and has known bugs (the one I >> fixed, for instance). How do you propose that we fix such bugs to >> support 2.10 without leaving the trunk frozen forever? > > I think Philipp made clear that new features are welcome at any time - > you just have to create the 1.5 branch before checking them in. That violates overall branching policy, which says that released stuff should have branches. We *have* bugs for 1.5, and they need to be fixed. Delaying creation of the release branch is a pure convenience, not justified in this case if it means that maintainers have to adjust to a different policy for Five than for any other project in the repository. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFI87Q+gerLs4ltQ4RAj9vAJ9teXvw2Kl71dsc5v5/eCLlao+RUgCg0byr q3gQDCl5rOKd77ZlQrinJSI= =iMRA -----END PGP SIGNATURE----- From y.2006_ at wcm-solutions.de Wed Oct 4 17:45:48 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Wed, 04 Oct 2006 17:45:48 +0200 Subject: [z3-five] SVN: Products.Five/branches/1.5/ Tag a release branch for the 1.5 line. In-Reply-To: <4523CED0.5030508@palladion.com> References: <20061004021719.DCCC620316E@mail.zope.org> <4523740B.20602@wcm-solutions.de> <4523AD4E.300@wcm-solutions.de> <4523CED0.5030508@palladion.com> Message-ID: <4523D72C.8090802@wcm-solutions.de> Hi Tres! Tres Seaver wrote: > yuppie wrote: >> I think Philipp made clear that new features are welcome at any time - >> you just have to create the 1.5 branch before checking them in. > > That violates overall branching policy, which says that released stuff > should have branches. We *have* bugs for 1.5, and they need to be > fixed. Delaying creation of the release branch is a pure convenience, > not justified in this case if it means that maintainers have to adjust > to a different policy for Five than for any other project in the repository. GenericSetup is also in the repository and has no release branches at all. Anyway. While I don't like the overall branching policy, keeping branching policies in sync is a good argument for doing some extra work. I still don't understand what's the advantage of starting the branch at the released version instead of the latest version. But since you volunteered to do the extra work I can live with the extra noise that makes. I'll shut up now. Yuppie From not.com at gmail.com Thu Oct 5 03:26:58 2006 From: not.com at gmail.com (yary) Date: Wed, 4 Oct 2006 18:26:58 -0700 Subject: [z3-five] Overriding main_template in zcml Message-ID: <75cbfa570610041826i3920ce05nf876bd4088e172f5@mail.gmail.com> Hello, I'd like to specify in zcml that I have a main_template in the filesystem I'd like to use fro my CMF site. I don't know what to put in the "for" attribute, or even if it's possible. I've created a main_template.pt file in my product's directory, and added this to my configure.zcml: What does the " ? " become, to say that I want to use my main_template.pt for CMF sites? I suppose I'll have to add a "traversable" tag as well, since I'm using Five 1.4 (Should I subclass CMF Site, so my new template doesn't affect other CMF sites? Not even sure how to go about that... sorry about being a newbie.) Thanks in advance From not.com at gmail.com Thu Oct 5 04:27:44 2006 From: not.com at gmail.com (yary) Date: Wed, 4 Oct 2006 19:27:44 -0700 Subject: [z3-five] Overriding main_template in zcml In-Reply-To: <75cbfa570610041826i3920ce05nf876bd4088e172f5@mail.gmail.com> References: <75cbfa570610041826i3920ce05nf876bd4088e172f5@mail.gmail.com> Message-ID: <75cbfa570610041927n3850019r1e290ac1beb94afa@mail.gmail.com> I've gotten further, but still not all the way. My test product is called Q. In it, I subclassed CMF Site, here's the core of it, in a file "portal.py": from Products.CMFDefault.Portal import CMFSite class QSite(CMFSite): meta_type='Q Site' InitializeClass(QSite) -plus, there's some glue in my __init__ that I copied from CMFDefault. I can create my Q Site and it works just like a CMFSite, good. Then I add to my configure.zcml: References: <75cbfa570610041826i3920ce05nf876bd4088e172f5@mail.gmail.com> <75cbfa570610041927n3850019r1e290ac1beb94afa@mail.gmail.com> Message-ID: <319e029f0610042338hea018aes3f06ef5b95883eb1@mail.gmail.com> On 10/5/06, yary wrote: > I suspect I need to add an interface for QSite? Or does CMF Site have > an interface I should be using here, that I need to add with an > "implements" directive? Well, theres ISiteRoot... However, in that case it would be used ONLY for the site, and not for everything, which most likely is what you want. Use "*" for everything. I can't promise you it works, though, main_template it supposed to be overridden in a skin. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From chris at simplistix.co.uk Thu Oct 5 10:36:07 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 05 Oct 2006 09:36:07 +0100 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors In-Reply-To: <200610041239.28588.restless.being@gmail.com> References: <200610021453.39260.restless.being@gmail.com> <7054C9BA2BF7839ACB411CDE@[192.168.0.28]> <45235F84.7090008@simplistix.co.uk> <200610041239.28588.restless.being@gmail.com> Message-ID: <4524C3F7.6090600@simplistix.co.uk> eXt wrote: > I read it but I think I faced a different problem here. I use Zope 2.10 and > very simple PageTemplate that is not dynamic at all. I don't have mixin of > different types of strings etc. I believe you have a mixture of strings and unicodes, whether or not you realise it... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From faassen at infrae.com Thu Oct 5 11:39:59 2006 From: faassen at infrae.com (Martijn Faassen) Date: Thu, 05 Oct 2006 11:39:59 +0200 Subject: [z3-five] five.intid: cool! Message-ID: <4524D2EF.5050606@infrae.com> Hi there, I just saw the announcement of five.intid on the cheeseshop. That's really cool! As far as I understand, this would also allow the Zope 3 catalog to work in Zope 2, right? Regards, Martijn From d.w.morriss at gmail.com Thu Oct 5 15:38:49 2006 From: d.w.morriss at gmail.com (whit) Date: Thu, 05 Oct 2006 08:38:49 -0500 Subject: [z3-five] five.intid: cool! In-Reply-To: <4524D2EF.5050606@infrae.com> References: <4524D2EF.5050606@infrae.com> Message-ID: Martijn Faassen wrote: > Hi there, > > I just saw the announcement of five.intid on the cheeseshop. That's > really cool! As far as I understand, this would also allow the Zope 3 > catalog to work in Zope 2, right? > > Regards, > > Martijn > I haven't tried it yet ;) but yeah that's the general idea(should also allow the z3 reference implementations to be adapted for zope2). I'm using it with rdflib, but I believe the idea is the same. note it's fresh out of the oven. would love to get some more eyes on it. currently this work is in the collective but I'd be willing to move it over to codespeak or the zope repo if people felt it more appropriate. https://svn.plone.org/svn/collective/five.intid/ also included is a pickleable keyreference implementation for zope2. one issue I did run into that bears noting is that fiveish packages that are not registered as python products have no clear way to register overrides. since everything I needed to override would at the latest be loaded into configuration by five.intid's configure.zcml, I put the includeOverrides at the end of that file. is there a better way to do this? -w From jim at zope.com Thu Oct 5 15:44:55 2006 From: jim at zope.com (Jim Fulton) Date: Thu, 05 Oct 2006 09:44:55 -0400 Subject: [z3-five] five.intid: cool! In-Reply-To: References: <4524D2EF.5050606@infrae.com> Message-ID: <45250C57.6050201@zope.com> whit wrote: ... > I haven't tried it yet ;) but yeah that's the general idea(should also > allow the z3 reference implementations to be adapted for zope2). I'm > using it with rdflib, but I believe the idea is the same. I'll note in passing that reference systems don't need intids. Integer ids are mainly an optimization for indexing structures because integer ids can be stored and compared more efficiently than key references. This is a trade-off, since key references can be dereferenced more efficiently than integer ids. Many reference systems can and should be implemented on key references directly. Jim -- Jim Fulton mailto:jim at zope.com Python Powered! CTO (540) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org From d.w.morriss at gmail.com Thu Oct 5 16:24:08 2006 From: d.w.morriss at gmail.com (whit) Date: Thu, 05 Oct 2006 09:24:08 -0500 Subject: [z3-five] five.intid: cool! In-Reply-To: <45250C57.6050201@zope.com> References: <4524D2EF.5050606@infrae.com> <45250C57.6050201@zope.com> Message-ID: Jim Fulton wrote: > whit wrote: > ... >> I haven't tried it yet ;) but yeah that's the general idea(should also >> allow the z3 reference implementations to be adapted for zope2). I'm >> using it with rdflib, but I believe the idea is the same. > > I'll note in passing that reference systems don't need intids. > Integer ids are mainly an optimization for indexing structures > because integer ids can be stored and compared more efficiently > than key references. This is a trade-off, since key references > can be dereferenced more efficiently than integer ids. > > Many reference systems can and should be implemented on key > references directly. > ah... good to know. I was wondering about the exact purpose of that indirection while working on this. -w From faassen at infrae.com Thu Oct 5 17:22:32 2006 From: faassen at infrae.com (Martijn Faassen) Date: Thu, 05 Oct 2006 17:22:32 +0200 Subject: [z3-five] five.intid: cool! In-Reply-To: References: <4524D2EF.5050606@infrae.com> Message-ID: <45252338.2030406@infrae.com> whit wrote: [snip] > currently this work is in the collective but I'd be willing to move it > over to codespeak or the zope repo if people felt it more appropriate. > > https://svn.plone.org/svn/collective/five.intid/ I think it would make sense to move this into Five eventually, so the zope repo might be a good idea. Regards, Martijn From d.w.morriss at gmail.com Thu Oct 5 17:05:47 2006 From: d.w.morriss at gmail.com (whit) Date: Thu, 05 Oct 2006 10:05:47 -0500 Subject: [z3-five] packaging and five Message-ID: rocky and I were kicking around the idea of breaking out parts of five into separate python packages to allow for more granular upgrades in between manage zope releases(and possible provide some relief for compatibility straddling and version churning). This could also allow for some setuptools based dependency management in the future. Basic idea is that parts of five critical to using zope 3 in zope2 move into zope2 proper; optional parts move into python distributions. thoughts? -w From faassen at infrae.com Thu Oct 5 17:23:43 2006 From: faassen at infrae.com (Martijn Faassen) Date: Thu, 05 Oct 2006 17:23:43 +0200 Subject: [z3-five] five.intid: cool! In-Reply-To: References: <4524D2EF.5050606@infrae.com> <45250C57.6050201@zope.com> Message-ID: <4525237F.6000609@infrae.com> whit wrote: > Jim Fulton wrote: >> whit wrote: >> ... >>> I haven't tried it yet ;) but yeah that's the general idea(should also >>> allow the z3 reference implementations to be adapted for zope2). I'm >>> using it with rdflib, but I believe the idea is the same. >> I'll note in passing that reference systems don't need intids. >> Integer ids are mainly an optimization for indexing structures >> because integer ids can be stored and compared more efficiently >> than key references. This is a trade-off, since key references >> can be dereferenced more efficiently than integer ids. >> >> Many reference systems can and should be implemented on key >> references directly. > > ah... good to know. I was wondering about the exact purpose of that > indirection while working on this. I am glad you didn't know, as at least we now have intid support. :) Regards, Martijn From not.com at gmail.com Thu Oct 5 20:59:57 2006 From: not.com at gmail.com (yary) Date: Thu, 5 Oct 2006 11:59:57 -0700 Subject: [z3-five] Overriding main_template in zcml In-Reply-To: <319e029f0610042338hea018aes3f06ef5b95883eb1@mail.gmail.com> References: <75cbfa570610041826i3920ce05nf876bd4088e172f5@mail.gmail.com> <75cbfa570610041927n3850019r1e290ac1beb94afa@mail.gmail.com> <319e029f0610042338hea018aes3f06ef5b95883eb1@mail.gmail.com> Message-ID: <75cbfa570610051159s4cc329c3y8c37f7ff8ce99e1a@mail.gmail.com> > ... I can't promise you it works, though, main_template it > supposed to be overridden in a skin. Will have to go back to skins... after a couple hours of playing here's my state: created a QSite (subclass of CMFSite with different name) instance named "Site", & change the name of the template. I try view it with "http://localhost:8080/SecondSite/view" with various combinations of zcml. My latest: All I see is the original template, not the contents of main_template.pt From optilude at gmx.net Thu Oct 5 22:13:32 2006 From: optilude at gmx.net (Martin Aspeli) Date: Thu, 05 Oct 2006 21:13:32 +0100 Subject: [z3-five] five.intid: cool! In-Reply-To: References: <4524D2EF.5050606@infrae.com> Message-ID: whit wrote: > one issue I did run into that bears noting is that fiveish packages that > are not registered as python products have no clear way to register > overrides. since everything I needed to override would at the latest be > loaded into configuration by five.intid's configure.zcml, I put the > includeOverrides at the end of that file. > > is there a better way to do this? If I'm understanding you correctly... could you not put a five.intid-overrides.zcml that does in etc/site-packages? At least that ought to work with later versions of Five. Martin From philipp at weitershausen.de Fri Oct 6 08:45:01 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri, 06 Oct 2006 08:45:01 +0200 Subject: [z3-five] packaging and five In-Reply-To: References: Message-ID: <4525FB6D.2040908@weitershausen.de> whit wrote: > rocky and I were kicking around the idea of breaking out parts of five > into separate python packages to allow for more granular upgrades in > between manage zope releases(and possible provide some relief for > compatibility straddling and version churning). > > This could also allow for some setuptools based dependency management in > the future. Yes. > Basic idea is that parts of five critical to using zope 3 in zope2 move > into zope2 proper; optional parts move into python distributions. I've sort of been pondering this thought myself for a while. For Zope 2.11, I have some plans to make a lot of code duplication in Five simply go away. Other parts, like the ZCML configuration, should indeed move into Zope 2 proper. So, in general I'm +1 on this. I'd rather see lots of "five.something" packages than having Products.Five grow and grow. Philipp From d.w.morriss at gmail.com Fri Oct 6 17:12:26 2006 From: d.w.morriss at gmail.com (whit) Date: Fri, 06 Oct 2006 10:12:26 -0500 Subject: [z3-five] five.intid: cool! In-Reply-To: References: <4524D2EF.5050606@infrae.com> Message-ID: Martin Aspeli wrote: > whit wrote: > >> one issue I did run into that bears noting is that fiveish packages that >> are not registered as python products have no clear way to register >> overrides. since everything I needed to override would at the latest be >> loaded into configuration by five.intid's configure.zcml, I put the >> includeOverrides at the end of that file. >> >> is there a better way to do this? > > > If I'm understanding you correctly... could you not put a > five.intid-overrides.zcml that does file="overrides.zcml" /> in etc/site-packages? > > At least that ought to work with later versions of Five. > > Martin as of six weeks and one day ago ;) http://svn.zope.org/Products.Five/branches/1.4/skel/site.zcml?rev=69744&view=markup thanks alec! -w From optilude at gmx.net Sat Oct 7 03:04:35 2006 From: optilude at gmx.net (Martin Aspeli) Date: Sat, 07 Oct 2006 02:04:35 +0100 Subject: [z3-five] zope2 easy_install In-Reply-To: References: Message-ID: whit wrote: > Easy install via setuptools and easy_install is very close to working > but has the following issues(observed installing into a workingenv.py > setup):: > > * package gets divided into 2 eggs (ie for zope2.9: > Zope-0.0.0-py2.4.egg, Zope-2.95_final-py2.4-macosx-10.4-i386.egg) > > * the second egg doesn't get added to the easyinstall.pth > > * the skeleton file zopectl and runzope can't find Zope2/Startup > (symlinking run.py and zopectl.py to bin/env and then editing the > scripts to look in $WORKING_ENV/bin works) > > With workingenv this is super nice though. all the scripts get stuck in > the env/bin, all the zope code into env/lib/python. er... what? I feel like I'm missing some context here :) Martin From georgeleejr at gmail.com Sat Oct 7 19:34:04 2006 From: georgeleejr at gmail.com (George Lee) Date: Sat, 7 Oct 2006 17:34:04 +0000 (UTC) Subject: [z3-five] =?utf-8?q?browser=3A_page_and_allowed=5Finterface?= Message-ID: Currently Five processes the "browser:page" and "allowed_interface" as follows, in method page of Products.Five.browser.metaconfigure: if allowed_interface is not None: for interface in allowed_interface: allowed_attributes.extend(interface.names()) However, if an interface subclasses another interface, then the superclass interface's names are not included in the allowed attributes! This seems very counter-intuitive. It seems that the code should use list(interface) instead of interface.names() -- is this correct? For example, I may want IFoo1 and IFoo2 both to have allowed names foo, bar, wam, kazam, but where IFoo1 has name foo1 and IFoo2 has name foo2. Right now, the only ways to allow all those name on IFoo1 are: * to define all those names explicitly in both IFoo1 and IFoo2 -- which results in useless duplication of code * to set allowed_attributes to both IFoo and IFoo1 -- which violates the principle that we should know what names are listed in IFoo1 without knowing what superclasses it inherits from Peace, George From philipp at weitershausen.de Sat Oct 7 23:06:42 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sat, 07 Oct 2006 23:06:42 +0200 Subject: [z3-five] five.intid: cool! In-Reply-To: <45250C57.6050201@zope.com> References: <4524D2EF.5050606@infrae.com> <45250C57.6050201@zope.com> Message-ID: <452816E2.5010000@weitershausen.de> Jim Fulton wrote: > whit wrote: > ... >> I haven't tried it yet ;) but yeah that's the general idea(should also >> allow the z3 reference implementations to be adapted for zope2). I'm >> using it with rdflib, but I believe the idea is the same. > > I'll note in passing that reference systems don't need intids. > Integer ids are mainly an optimization for indexing structures > because integer ids can be stored and compared more efficiently > than key references. Int ids can also be round-tripped to the browser much more easily. E.g. when I'm creating a UI for a reference system that lets me select the objects that I'm creating a reference for, it's a lot simpler to use int ids. > This is a trade-off, since key references can be dereferenced more > efficiently than integer ids. What do you mean? > Many reference systems can and should be implemented on key > references directly. Possibly, though at least for the browser stuff integers are more attractive due to their simplicity. And, of course, if you have a system that has lots of references and needs set operations, it may also make a difference to use integers and integer-flavoured BTrees. From philipp at weitershausen.de Sat Oct 7 23:14:56 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sat, 07 Oct 2006 23:14:56 +0200 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors In-Reply-To: <4524C3F7.6090600@simplistix.co.uk> References: <200610021453.39260.restless.being@gmail.com> <7054C9BA2BF7839ACB411CDE@[192.168.0.28]> <45235F84.7090008@simplistix.co.uk> <200610041239.28588.restless.being@gmail.com> <4524C3F7.6090600@simplistix.co.uk> Message-ID: <452818D0.90903@weitershausen.de> Chris Withers wrote: > eXt wrote: >> I read it but I think I faced a different problem here. I use Zope 2.10 and >> very simple PageTemplate that is not dynamic at all. I don't have mixin of >> different types of strings etc. > > I believe you have a mixture of strings and unicodes, whether or not you > realise it... Right. The problem is this: the Zope 2.9 ZPT implementation uses str's internally. In good ol' Zope 2 times, people weren't using unicode but 8bit strings which works fine. If you're using unicode, that also works fine, because the str's that Zope 2.9 ZPTs use internally are ASCII only. The problem arises in Zope 2.10 which uses unicode's internally (instead of str's). That makes it impossible to include 8bit strings in ZPTs (because unicode and 8bit strings can't be combined). Here's some more background on the issue and a proposed fix: http://www.zope.org/Collectors/Zope/2180 If this solves the problem, we should apply the patch. From d.w.morriss at gmail.com Sun Oct 8 00:13:12 2006 From: d.w.morriss at gmail.com (whit) Date: Sat, 07 Oct 2006 17:13:12 -0500 Subject: [z3-five] zope2 easy_install In-Reply-To: References: Message-ID: <45282678.3040206@gmail.com> results of trying: easy_install svn://svn.zope.org/repos/main/Zope/branches/2.9 to install zope(vs. the checkout, configure, build dance). -w Martin Aspeli wrote: > whit wrote: >> Easy install via setuptools and easy_install is very close to working >> but has the following issues(observed installing into a workingenv.py >> setup):: >> >> * package gets divided into 2 eggs (ie for zope2.9: >> Zope-0.0.0-py2.4.egg, Zope-2.95_final-py2.4-macosx-10.4-i386.egg) >> >> * the second egg doesn't get added to the easyinstall.pth >> >> * the skeleton file zopectl and runzope can't find Zope2/Startup >> (symlinking run.py and zopectl.py to bin/env and then editing the >> scripts to look in $WORKING_ENV/bin works) >> >> With workingenv this is super nice though. all the scripts get stuck in >> the env/bin, all the zope code into env/lib/python. > > er... what? > > I feel like I'm missing some context here :) > > Martin > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV From richard at iopen.net Sun Oct 8 06:39:12 2006 From: richard at iopen.net (Richard Waid) Date: Sun, 08 Oct 2006 17:39:12 +1300 Subject: [z3-five] Patch to enable recursive resourceDirectory support In-Reply-To: <1155789556.11292.3.camel@ubuntu> References: <1155769999.24847.27.camel@ubuntu> <44E3EE1D.3060500@weitershausen.de> <1155789556.11292.3.camel@ubuntu> Message-ID: <1160282352.21623.1.camel@ubuntu> On Thu, 2006-08-17 at 16:39 +1200, Richard Waid wrote: > On Thu, 2006-08-17 at 06:18 +0200, Philipp von Weitershausen wrote: > > Richard Waid wrote: > > > I noticed that the resourceDirectory directive isn't recursive as it is > > > in Zope3, so I backported the behaviour from Zope3. The patch is > > > attached. > > > > Hey, thanks for the patch. Can you also provide a short unit test for > > this (extending an existing one should be enough)? Then we can include > > this patch right away. > > Sure: Just following up on this one, did the recursive support get merged? Thanks, --Richard From richard at iopen.net Sun Oct 8 06:50:30 2006 From: richard at iopen.net (Richard Waid) Date: Sun, 08 Oct 2006 17:50:30 +1300 Subject: [z3-five] Bug in defaultView? Message-ID: <1160283030.21623.12.camel@ubuntu> This could be a bug, or it could be a misunderstanding of how browser:defaultView is supposed to work in Five. I'm also using Zope-2.9, so this may be 'fixed' in a later version of Five/Zope too. Ok, basically I want to have a defaultView of index.html on objects that implement an index.html view, otherwise fallback to index_html. The __browser_default__ method in viewable.py/Viewable suggests that this should be the behaviour (it has a fallback that says it falls back to index_html), except that the path returned from IBrowserDefault(self).defaultView(request) is _always_ index.html. Here's an example. IGSContentFolder is a marker interface that is (typically) used on a Folder to provide some views, including an index.html. Not _all_ Folder objects are marked with this interface. But when I do: --- --- ALL Folder objects only ever return 'index.html', even when the object doesn't implement that (because it isn't marked as IGSContentFolder). I can kinda see that this could be because of the global defaultView being set to index.html. If that is the case, my question then becomes ... how _do_ I set a default view of index.html only on a subset of Folder objects? I suspect we may have legacy code which uses index_html implicitly (Zope2 encouraged such behaviour at times ;)). Many thanks, --Richard From regebro at gmail.com Sun Oct 8 12:31:22 2006 From: regebro at gmail.com (Lennart Regebro) Date: Sun, 8 Oct 2006 12:31:22 +0200 Subject: [z3-five] Bug in defaultView? In-Reply-To: <1160283030.21623.12.camel@ubuntu> References: <1160283030.21623.12.camel@ubuntu> Message-ID: <319e029f0610080331x4ff87b7ag2e036f2775048e5b@mail.gmail.com> On 10/8/06, Richard Waid wrote: > This could be a bug, or it could be a misunderstanding of how > browser:defaultView is supposed to work in Five. I'm also using > Zope-2.9, so this may be 'fixed' in a later version of Five/Zope too. > > Ok, basically I want to have a defaultView of index.html on objects that > implement an index.html view, otherwise fallback to index_html. > > The __browser_default__ method in viewable.py/Viewable suggests that > this should be the behaviour (it has a fallback that says it falls back > to index_html), Thats a documentation bug in that case. > name="index.html"/> Yes, that will make the default view index.html, thusly overridding the Zope2 default of index_html. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From richard at iopen.net Sun Oct 8 23:34:53 2006 From: richard at iopen.net (Richard Waid) Date: Mon, 09 Oct 2006 10:34:53 +1300 Subject: [z3-five] Bug in defaultView? In-Reply-To: <319e029f0610080331x4ff87b7ag2e036f2775048e5b@mail.gmail.com> References: <1160283030.21623.12.camel@ubuntu> <319e029f0610080331x4ff87b7ag2e036f2775048e5b@mail.gmail.com> Message-ID: <1160343293.26195.12.camel@ubuntu> On Sun, 2006-10-08 at 12:31 +0200, Lennart Regebro wrote: > On 10/8/06, Richard Waid wrote: > > This could be a bug, or it could be a misunderstanding of how > > browser:defaultView is supposed to work in Five. I'm also using > > Zope-2.9, so this may be 'fixed' in a later version of Five/Zope too. > > > > Ok, basically I want to have a defaultView of index.html on objects that > > implement an index.html view, otherwise fallback to index_html. > > > > The __browser_default__ method in viewable.py/Viewable suggests that > > this should be the behaviour (it has a fallback that says it falls back > > to index_html), > > Thats a documentation bug in that case. More on this below. > > > name="index.html"/> > > Yes, that will make the default view index.html, thusly overridding > the Zope2 default of index_html. I'm thinking I wasn't clear enough. I understand that this browser:defaultView directive means that for objects implementing IGSContentFolder, index.html will be the default. I'm not clear why: which is _required_ in the Zope-2.9 version of Five to let the browser:defaultView directive work, also enforces 'index.html' as the default (independently of the browser:defaultView directive). If it is because the global defaultView for Five/Z3 is set to index.html ... well, ok, but in that case why the code in viewable.py: --- def __browser_default__(self, request): obj = self path = None if request['REQUEST_METHOD'] not in ('GET', 'POST'): return obj, [request['REQUEST_METHOD']] try: obj, path = IBrowserDefault(self).defaultView(request) except ComponentLookupError: pass if path: if len(path) == 1 and path[0] == '__call__': return obj, ('fallback_call__',) return obj, path return self.__fallback_default__(request) --- As far as I can tell, when the patch is in place (ie. when five:defaultViewable is set for an object), the __fallback_default__ is never called. I realise this is probably irrelevant now, since it doesn't work like this in Zope-2.10. --Richard From rocky at serverzen.com Mon Oct 9 01:53:54 2006 From: rocky at serverzen.com (Rocky Burt) Date: Sun, 08 Oct 2006 21:23:54 -0230 Subject: [z3-five] browser: page and allowed_interface In-Reply-To: References: Message-ID: <1160351632.5840.21.camel@localhost> On Sat, 2006-07-10 at 17:34 +0000, George Lee wrote: > Currently Five processes the "browser:page" and "allowed_interface" as follows, > in method page of Products.Five.browser.metaconfigure: > > if allowed_interface is not None: > for interface in allowed_interface: > allowed_attributes.extend(interface.names()) > > However, if an interface subclasses another interface, then the superclass > interface's names are not included in the allowed attributes! This seems very > counter-intuitive. Yeah, I recently banged into this as well. I was expecting that when I allowed_interface an interface, the interface's super-interface(s) would also be included. I guess the real question here is, what does pure Zope 3 do ? - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061008/6a7d8b8c/attachment.pgp From restless.being at gmail.com Mon Oct 9 09:18:36 2006 From: restless.being at gmail.com (eXt) Date: Mon, 9 Oct 2006 09:18:36 +0200 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors In-Reply-To: <452818D0.90903@weitershausen.de> References: <200610021453.39260.restless.being@gmail.com> <4524C3F7.6090600@simplistix.co.uk> <452818D0.90903@weitershausen.de> Message-ID: <200610090918.36736.restless.being@gmail.com> Dnia sobota, 7 pazdziernika 2006 23:14, Philipp von Weitershausen napisal: > Right. The problem is this: the Zope 2.9 ZPT implementation uses str's > internally. In good ol' Zope 2 times, people weren't using unicode but > 8bit strings which works fine. If you're using unicode, that also works > fine, because the str's that Zope 2.9 ZPTs use internally are ASCII only. > The problem arises in Zope 2.10 which uses unicode's internally (instead > of str's). That makes it impossible to include 8bit strings in ZPTs > (because unicode and 8bit strings can't be combined). Nice clarification of things. > Here's some more background on the issue and a proposed fix: > http://www.zope.org/Collectors/Zope/2180 > > If this solves the problem, we should apply the patch. It doesn't work wor me (nothing has changed after the patch was applied) :( -- Jakub Wisniowski From regebro at gmail.com Mon Oct 9 13:47:23 2006 From: regebro at gmail.com (Lennart Regebro) Date: Mon, 9 Oct 2006 13:47:23 +0200 Subject: [z3-five] Bug in defaultView? In-Reply-To: <1160343293.26195.12.camel@ubuntu> References: <1160283030.21623.12.camel@ubuntu> <319e029f0610080331x4ff87b7ag2e036f2775048e5b@mail.gmail.com> <1160343293.26195.12.camel@ubuntu> Message-ID: <319e029f0610090447v4f1518e4vf6a855e3589793f0@mail.gmail.com> On 10/8/06, Richard Waid wrote: >I'm not clear why: > > > > which is _required_ in the Zope-2.9 version of Five to let the > browser:defaultView directive work, also enforces 'index.html' as the > default (independently of the browser:defaultView directive). Ah. Correct, it is not clear why. But that's how it is. If it's good or bad I don't know. :) In any case, you basically do not need five:defaultViewable unless you also want to set browser:defaultView, so it shouldn't be a problem, right? > I realise this is probably irrelevant now, since it doesn't work like > this in Zope-2.10. Well, I think defaultViewable will still set the default to index.html, if I remember correctly. But you don't need it any more, correct. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From not.com at gmail.com Wed Oct 11 00:44:46 2006 From: not.com at gmail.com (yary) Date: Tue, 10 Oct 2006 15:44:46 -0700 Subject: [z3-five] Skins via zcml, viewable in CMF portal_skins? Message-ID: <75cbfa570610101544p3bfb6ca5q242b7ca241ffc41@mail.gmail.com> Hello all, I have some ZCML sucessfully declaring a skin: I can open my site, append ++skin++QSkin and there's no error. However the management screen portal_skins/properties doesn't show QLayer or QSkin, so how is the user supposed to choose QSkin as the default for a particular site? thanks -y From ree at ree.hu Wed Oct 11 07:52:32 2006 From: ree at ree.hu (Balazs Ree) Date: Wed, 11 Oct 2006 07:52:32 +0200 Subject: [z3-five] Zope 2.10 and UnicodeDecodeErrors References: <200610021453.39260.restless.being@gmail.com> <7054C9BA2BF7839ACB411CDE@[192.168.0.28]> <45235F84.7090008@simplistix.co.uk> <200610041239.28588.restless.being@gmail.com> <4524C3F7.6090600@simplistix.co.uk> <452818D0.90903@weitershausen.de> Message-ID: <0eduv3-qhi.ln1@kiiu.ree> Sat, 07 Oct 2006 23:14:56 +0200 keltez?ssel Philipp von Weitershausen wrote: > Here's some more background on the issue and a proposed fix: > http://www.zope.org/Collectors/Zope/2180 > > If this solves the problem, we should apply the patch. I've attached some tests usable to check the presence of the issue and if any particular solution solves it. In case there is a patch that solves all of them (Philipp's first patch only fixed a part of the cases) I also suggest that we emit deprecation warning in case the fix comes in effect. This would allow developers to see what particular insertions cause the problem and fix them to proper unicode. -- Balazs Ree From not.com at gmail.com Wed Oct 11 21:03:57 2006 From: not.com at gmail.com (yary) Date: Wed, 11 Oct 2006 12:03:57 -0700 Subject: [z3-five] handler not getting called Message-ID: <75cbfa570610111203m69064de8m18124847047d85f1@mail.gmail.com> I'm trying to add a handler, but it doesn't get called. ZCML: currently addedQSite prints a debug message and then throws an exception- trying to make it hard to miss... but I can create a QSite and not see the debug message or exception. My first attempt I used IObjectAddedEvent, and switched to IObjectEvent to try and catch any event, still nothing calls my addedQSite on add or delete. Any ideas on how to fix? From philipp at weitershausen.de Wed Oct 11 21:46:53 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Wed, 11 Oct 2006 21:46:53 +0200 Subject: [z3-five] handler not getting called In-Reply-To: <75cbfa570610111203m69064de8m18124847047d85f1@mail.gmail.com> References: <75cbfa570610111203m69064de8m18124847047d85f1@mail.gmail.com> Message-ID: <452D4A2D.4040509@weitershausen.de> yary wrote: > I'm trying to add a handler, but it doesn't get called. ZCML: > > > > interface=".portal.IQSite" > /> > for=".portal.IQSite zope.app.container.interfaces.IObjectEvent" > handler=".portal.addedQSite" > /> > > currently addedQSite prints a debug message and then throws an > exception- trying to make it hard to miss... but I can create a QSite > and not see the debug message or exception. My first attempt I used > IObjectAddedEvent, and switched to IObjectEvent to try and catch any > event, still nothing calls my addedQSite on add or delete. Any ideas > on how to fix? How are you creating a QSite object? Most of Zope 2 or the CMF doesn't send events yet, unfortunately. It would be a nice sprint topic or task to add such events to Zope 2, though. Philipp From not.com at gmail.com Wed Oct 11 22:59:35 2006 From: not.com at gmail.com (yary) Date: Wed, 11 Oct 2006 13:59:35 -0700 Subject: [z3-five] handler not getting called In-Reply-To: <452D4A2D.4040509@weitershausen.de> References: <75cbfa570610111203m69064de8m18124847047d85f1@mail.gmail.com> <452D4A2D.4040509@weitershausen.de> Message-ID: <75cbfa570610111359h4239afbbh5bc315bbfc77eb7@mail.gmail.com> On 11/10/06, Philipp von Weitershausen wrote: > yary wrote: > > I'm trying to add a handler, but it doesn't get called. ZCML: > > > > > > > > > interface=".portal.IQSite" > > /> > > > for=".portal.IQSite zope.app.container.interfaces.IObjectEvent" > > handler=".portal.addedQSite" > > /> > > > > currently addedQSite prints a debug message and then throws an > > exception- trying to make it hard to miss... but I can create a QSite > > and not see the debug message or exception. My first attempt I used > > IObjectAddedEvent, and switched to IObjectEvent to try and catch any > > event, still nothing calls my addedQSite on add or delete. Any ideas > > on how to fix? > > How are you creating a QSite object? Most of Zope 2 or the CMF doesn't > send events yet, unfortunately. It would be a nice sprint topic or task > to add such events to Zope 2, though. QSite is a subclass of CMFSite- in its entirety: class QSite(CMFSite): meta_type='Q Site' My product initializes it with initializeBases... & registerClass. I add a 'Q Site' to my Zope root through the management interface, and that's where I was hoping to get the event notification. I suspected that the event methods were more intended for content objects written from scratch, still, was hoping the "magic" worked "outside the box" as well! Thanks for alerting me that I can't expect events to work on Zope2-ish objects yet. Hope you don't mind me cc'ing to the five list on this response, so others can see that it is closed. What I'm trying to do in the big picture, is write a product that comes with an optional skin, which it installs on instantiation. Will post a more detailed request for help to the zope users list. From d.schulz81 at gmx.net Tue Oct 17 18:42:15 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Tue, 17 Oct 2006 18:42:15 +0200 Subject: [z3-five] Formlib and genuine add forms in Plone Message-ID: <453507E7.70602@gmx.net> Hi, I am currently learning how to do a content type with Formlib ( Five 1.4.1, Zope 2.9.5 and Plone 2.5.1 ) that should contain a genuine add form, that means that the item is not created before entering any value like in Archtypes (without portal factory). http://plone.org/documentation/tutorial/using-zope-formlib-with-plone/formlib-and-content-types I worked through this example. In the end the author states that "The only main missing piece (from formlib's perspective) here is using an auto-generated add form. While we can build those, they can't easily be hooked into Plone as Plone feels it needs to create the content first before displaying any forms." How would it be if we don't use the Archetypes BaseContent class to build the ContentType (like in the tutorial), but the OFS.SimpleItem (there is an example in formlib/tests directory)? Would it be possible to auto generate a working add form? Are there any examples where it actually really works? I have looked at a few examples now and everybody makes it a litte bit different..... does it make sense to build upon Archetypes BaseContent or not? How do you make Content Types? Greetings Dennis From D.Schulz81 at gmx.net Tue Oct 17 19:00:51 2006 From: D.Schulz81 at gmx.net (Dennis Schulz) Date: Tue, 17 Oct 2006 19:00:51 +0200 Subject: [z3-five] Calendar Widget in zope.app.form.browser ? Message-ID: <20061017170051.197080@gmx.net> Hi, I am new to zope.formLib and Zope 3 and I am currently trying to understand the Zope 3 schema. I saw that there is a zope.app.schema.DateTime field. When I add this to the schema the default widget is a text field. Is there a widget similar to Archetypes Calendar Widget? How can I connect this to a calendar widget over zope.app.form.browser? I am generally looking for a overview of all widgets and bigger examples of complex content types. Can anybody help me? Thanks, Dennis -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer From ra at burningman.com Tue Oct 17 19:25:52 2006 From: ra at burningman.com (Rob Miller) Date: Tue, 17 Oct 2006 10:25:52 -0700 Subject: [z3-five] Formlib and genuine add forms in Plone In-Reply-To: <453507E7.70602@gmx.net> References: <453507E7.70602@gmx.net> Message-ID: <45351220.2020108@burningman.com> Dennis Schulz wrote: > Hi, > > I am currently learning how to do a content type with Formlib ( Five > 1.4.1, Zope 2.9.5 and Plone 2.5.1 ) that should contain a genuine add > form, that means that the item is not created before entering any value > like in Archtypes (without portal factory). > > http://plone.org/documentation/tutorial/using-zope-formlib-with-plone/formlib-and-content-types > > I worked through this example. In the end the author states that "The > only main missing piece (from formlib's perspective) here is using an > auto-generated add form. While we can build those, they can't easily be > hooked into Plone as Plone feels it needs to create the content first > before displaying any forms." there are two problems here that i'm aware of. one, which is AT-specific, is that AT schemas expect to be rendered against an existing AT object, they don't work w/o one. the other, which is not AT-specific, is that Plone's add menu automatically triggers the creation of an object of the specified type. > How would it be if we don't use the Archetypes BaseContent class to > build the ContentType (like in the tutorial), but the OFS.SimpleItem > (there is an example in formlib/tests directory)? i don't think this changes things too much. formlib-based forms work w/o the need to be rendered against an existing object, as long as you're not using any interface generated by AT schema then it should be possible to generate a form before the object has been created. > Would it be possible to auto generate a working add form? yes. for smooth integration it would require some changes to Plone's content adding infrastructure, so that when you use the menus to add a piece of content it is not assumed that the content should be created immediately. it may be possible simply by developing a new version of the 'createObject.cpy' script, so that it checks a registry to see whether a given type should be created the old way, or if it should merely traverse to the addform view instead. > Are there any > examples where it actually really works? yes. there's a product called Fate in the AT svn repository on plone.org that generates working addforms for full AT schema driven content. it does this by generating a "stub" object of the right type and rendering the schema against that stub. the "real" object is not created until after the form is submitted. IIRC, however, it did not handle the menu integration issue. the solution i mentioned above would be a quick fix, however. > I have looked at a few examples > now and everybody makes it a litte bit different..... does it make sense > to build upon Archetypes BaseContent or not? depends. building on BaseContent means you'll play better with the rest of Plone, b/c you'll still support such niceties as the reference engine and catalog multiplexing. but AT objects are pretty heavy, if you need to produce hundreds of thousands of a particular type, you can make them much lighter and more efficient by not using AT. > How do you make Content Types? the bare minimum, i believe, is that you need to be a regular Zope object (e.g. by subclassing from SimpleItem) and you need to subclass DynamicType, PortalContent, and (arguably optional) CMFCatalogAware, all defined in CMFCore. plus you need to register a TypeInfo object with the types tool. it may be possible to do so with even less, but i believe this would be sufficient. this may or may not belong on the five list, btw; it seems pretty Plone-specific to me, it may make more sense to have this on the plone-dev list. -r From rocky at serverzen.com Tue Oct 17 19:54:32 2006 From: rocky at serverzen.com (Rocky Burt) Date: Tue, 17 Oct 2006 15:24:32 -0230 Subject: [z3-five] Calendar Widget in zope.app.form.browser ? In-Reply-To: <20061017170051.197080@gmx.net> References: <20061017170051.197080@gmx.net> Message-ID: <1161107670.5842.89.camel@localhost> On Tue, 2006-17-10 at 19:00 +0200, Dennis Schulz wrote: > I am new to zope.formLib and Zope 3 and I am currently trying to understand the Zope 3 schema. > > I saw that there is a zope.app.schema.DateTime field. > When I add this to the schema the default widget is a text field. > Is there a widget similar to Archetypes Calendar Widget? > How can I connect this to a calendar widget over zope.app.form.browser? Archetypes widgets and Zope 3 widgets are currently not compatible. I *believe* there is a calenadar style widget here but I have not tested it. http://svn.zope.org/zc.datetimewidget - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061017/a1223dc1/attachment.pgp From k_vertigo at objectrealms.net Tue Oct 17 20:01:46 2006 From: k_vertigo at objectrealms.net (Kapil Thangavelu) Date: Tue, 17 Oct 2006 14:01:46 -0400 Subject: [z3-five] Calendar Widget in zope.app.form.browser ? In-Reply-To: <1161107670.5842.89.camel@localhost> References: <20061017170051.197080@gmx.net> <1161107670.5842.89.camel@localhost> Message-ID: afaik, anything that depends on zc.resourcelibrary won't have access to the specified resources in z2 (at least it hasn't for me), due to differences in publication/request runtimes, which in turn probably means a non functional calendar widget. -k On Tue, 17 Oct 2006 13:54:32 -0400, Rocky Burt wrote: > On Tue, 2006-17-10 at 19:00 +0200, Dennis Schulz wrote: >> I am new to zope.formLib and Zope 3 and I am currently trying to >> understand the Zope 3 schema. >> >> I saw that there is a zope.app.schema.DateTime field. >> When I add this to the schema the default widget is a text field. >> Is there a widget similar to Archetypes Calendar Widget? >> How can I connect this to a calendar widget over zope.app.form.browser? > > Archetypes widgets and Zope 3 widgets are currently not compatible. I > *believe* there is a calenadar style widget here but I have not tested > it. > > http://svn.zope.org/zc.datetimewidget > > - Rocky > From fafhrd at datacom.kz Thu Oct 19 14:11:36 2006 From: fafhrd at datacom.kz (Nikolay Kim) Date: Thu, 19 Oct 2006 18:11:36 +0600 Subject: [z3-five] Five 1.5 bug Message-ID: <1161259896.7582.3.camel@localhost.localdomain> i can find five bugtracker. bug with directive deprecated warning File "/zope/Zope2.10/GadozProducts/Five/metaconfigure.py", line 51, in __init__ warnings.warn_explicit( zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/zope/Zope2.10/etc/site.zcml", line 18.2-18.23 ZopeXMLConfigurationError: File "/zope/Zope2.10/Products/CMFPlone/configure.zcml", line 5.2-5.32 ZopeXMLConfigurationError: File "/zope/Zope2.10/Products/CMFPlone/browser/configure.zcml", line 5.2 NameError: global name 'warnings' is not defined From maciej.wisniowski at coig.katowice.pl Thu Oct 19 15:29:26 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Thu, 19 Oct 2006 15:29:26 +0200 Subject: [z3-five] Menu and MenuItem in Five Message-ID: <45377DB6.7010605@coig.katowice.pl> Hi I'm able to define menu and menu items with Five directives in configure.zcml. I found that i can get menu items with: context/@@view_get_menu/zmi_views for my menu named 'zmi_views'. Is this possible somehow to get these menu items to be visible in ZMI just like standard tabs? Now I have this in my code: manage_options = ( PropertyManager.manage_options + \ SimpleItem.manage_options #+ \ #globalBrowserMenuService.getMenu('testmenu', IMain, IBrowserRequest) ) It displays tabs like Properties, Undo etc. I want to show one more tab defined with Five... What can I do? -- Maciej Wisniowski From regebro at gmail.com Thu Oct 19 15:34:20 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu, 19 Oct 2006 15:34:20 +0200 Subject: [z3-five] Menu and MenuItem in Five In-Reply-To: <45377DB6.7010605@coig.katowice.pl> References: <45377DB6.7010605@coig.katowice.pl> Message-ID: <319e029f0610190634n74bb32fr2490dc1ae1d1d2c6@mail.gmail.com> On 10/19/06, Maciej Wisniowski wrote: > Is this possible somehow to get these menu items to be > visible in ZMI just like standard tabs? Short answer: no. Long answer: Of course, but it's very complicated. :) > Now I have this in my code: > > manage_options = ( PropertyManager.manage_options + \ > SimpleItem.manage_options #+ \ > #globalBrowserMenuService.getMenu('testmenu', > IMain, IBrowserRequest) > ) That will firstly be executed when the module is imported, and will not include all the menues defined in any case, and secondly, that will return a list of menu items, not a list of ZMI-tabs. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From fafhrd at datacom.kz Thu Oct 19 15:31:18 2006 From: fafhrd at datacom.kz (Nikolay Kim) Date: Thu, 19 Oct 2006 19:31:18 +0600 Subject: [z3-five] interaction and Five1.5 Message-ID: <1161264678.7582.5.camel@localhost.localdomain> Hi, Seems that five 1.5 doesn't install interaction object for zope3? or i miss something? From regebro at gmail.com Thu Oct 19 15:38:23 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu, 19 Oct 2006 15:38:23 +0200 Subject: [z3-five] Five 1.5 bug In-Reply-To: <1161259896.7582.3.camel@localhost.localdomain> References: <1161259896.7582.3.camel@localhost.localdomain> Message-ID: <319e029f0610190638oe0b63e6h423564171b058097@mail.gmail.com> On 10/19/06, Nikolay Kim wrote: > i can find five bugtracker. Well, that's the normal Zope2 bugtracker. And please include the zcml-statement that caused the error, it would speed thinks up. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From plone at hannosch.info Thu Oct 19 15:48:57 2006 From: plone at hannosch.info (Hanno Schlichting) Date: Thu, 19 Oct 2006 15:48:57 +0200 Subject: [z3-five] Five 1.5 bug In-Reply-To: <319e029f0610190638oe0b63e6h423564171b058097@mail.gmail.com> References: <1161259896.7582.3.camel@localhost.localdomain> <319e029f0610190638oe0b63e6h423564171b058097@mail.gmail.com> Message-ID: <45378249.3070400@hannosch.info> Hi. Lennart Regebro wrote: > On 10/19/06, Nikolay Kim wrote: >> i can find five bugtracker. > > Well, that's the normal Zope2 bugtracker. > And please include the zcml-statement that caused the error, it would > speed thinks up. You have already fixed the bug he talks about on Five trunk (http://svn.zope.org/Products.Five/trunk/CHANGES.txt?rev=69765&view=rev). This is just not included in any Five release so far and thus not included in Zope 2.10 final either. See http://www.zope.org/Collectors/Zope/2168 for the original bug report. Hanno From plone at hannosch.info Thu Oct 19 16:00:21 2006 From: plone at hannosch.info (Hanno Schlichting) Date: Thu, 19 Oct 2006 16:00:21 +0200 Subject: [z3-five] Five 1.5 bug In-Reply-To: <1161259896.7582.3.camel@localhost.localdomain> References: <1161259896.7582.3.camel@localhost.localdomain> Message-ID: <453784F5.1020800@hannosch.info> Hi. Nikolay Kim wrote: > i can find five bugtracker. > > bug with directive deprecated warning > > File "/zope/Zope2.10/GadozProducts/Five/metaconfigure.py", line 51, in > __init__ > warnings.warn_explicit( > zope.configuration.xmlconfig.ZopeXMLConfigurationError: File > "/zope/Zope2.10/etc/site.zcml", line 18.2-18.23 > ZopeXMLConfigurationError: File > "/zope/Zope2.10/Products/CMFPlone/configure.zcml", line 5.2-5.32 > ZopeXMLConfigurationError: File > "/zope/Zope2.10/Products/CMFPlone/browser/configure.zcml", line 5.2 > NameError: global name 'warnings' is not defined Even if you would use a fixed version of Five you would still run into a lot of problems, as you are trying to run Plone 2.5.x against Zope 2.10, which is neither a supported nor working combination. You will have to stay with latest Zope 2.9 release for Plone 2.5 and you will have to wait for Plone 3.0 for Zope 2.10 support. Hanno From maciej.wisniowski at coig.katowice.pl Thu Oct 19 21:44:20 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Thu, 19 Oct 2006 21:44:20 +0200 Subject: [z3-five] Menu and MenuItem in Five In-Reply-To: <319e029f0610190634n74bb32fr2490dc1ae1d1d2c6@mail.gmail.com> References: <45377DB6.7010605@coig.katowice.pl> <319e029f0610190634n74bb32fr2490dc1ae1d1d2c6@mail.gmail.com> Message-ID: <4537D594.6020709@coig.katowice.pl> >> Is this possible somehow to get these menu items to be >> visible in ZMI just like standard tabs? > > Short answer: no. > > Long answer: Of course, but it's very complicated. :) Seems that I didn't know that it is complicated and I did this... ;) I've just defined filtered_manage_options function for my content class like: ------------------------- from zope.app import zapi class MyClass(SimpleItem): (...) def filtered_manage_options(self, REQUEST=None): """test... """ options = SimpleItem.filtered_manage_options(self, REQUEST) # it is Zope2.8 so we have to use getView instead of getMultiAdapter view = zapi.getView(self, 'view_get_menu' ,self.REQUEST) view = view.__of__(self) five_options = view['zmi_views'] for d in five_options: #change title to label d['label'] = d.get('title', '') options.append(d) return options ------------------------- configure.zcml: ------------------------- ------------------------- and my page template nope.pt: -------------------------

Generic Header

print nopeee

Generic Footer

------------------------- Did I miss something here?? -- Maciej Wisniowski From maciej.wisniowski at coig.katowice.pl Fri Oct 20 08:55:40 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Fri, 20 Oct 2006 08:55:40 +0200 Subject: [z3-five] Menu and MenuItem in Five In-Reply-To: <4537D594.6020709@coig.katowice.pl> References: <45377DB6.7010605@coig.katowice.pl> <319e029f0610190634n74bb32fr2490dc1ae1d1d2c6@mail.gmail.com> <4537D594.6020709@coig.katowice.pl> Message-ID: <453872EC.9030301@coig.katowice.pl> > and my page template nope.pt: > ------------------------- >

Generic Header

> print nopeee >

Generic Footer

> ------------------------- > I forgot to say that I have 'generic' attribute which is a ZPT with few simple macros. If somebody is interested I may post it's definition. AFAIR it was taken from another Zope product like Boring or something like that. > Did I miss something here?? Today I found that I missed two things: 1. Ocassionaly I got AttributeError: 'zope.thread.local' object has no attribute 'interaction'. Seems to be same thing as this one: http://www.zope.org/Collectors/Zope/2190 so I added: from Products.Five import security security.newInteraction() 2. tabs from Five were not correctly highlighted It was necessary to change @@ to %40 in 'action' d['action'] = d['action'].replace('@', '%40') Finally it looks like: def filtered_manage_options(self, REQUEST=None): """test... """ options = SimpleItem.filtered_manage_options(self, REQUEST) security.newInteraction() # it is Zope2.8 so we have to use getView instead of getMultiAdapter view = zapi.getView(self, 'view_get_menu' ,self.REQUEST) view = view.__of__(self) five_options = view['zmi_views'] for d in five_options: #change title to label d['label'] = d.get('title', '') d['action'] = d['action'].replace('@', '%40') options.append(d) return options I wonder whether all of this is necessary if I still can use simple 'old way' of defining management tabs. But till now I was not able to realize what for this 'menu' stuff from zcml may be used for in Z2 :) -- Maciej Wisniowski From regebro at gmail.com Fri Oct 20 09:14:14 2006 From: regebro at gmail.com (Lennart Regebro) Date: Fri, 20 Oct 2006 09:14:14 +0200 Subject: [z3-five] Menu and MenuItem in Five In-Reply-To: <4537D594.6020709@coig.katowice.pl> References: <45377DB6.7010605@coig.katowice.pl> <319e029f0610190634n74bb32fr2490dc1ae1d1d2c6@mail.gmail.com> <4537D594.6020709@coig.katowice.pl> Message-ID: <319e029f0610200014kc9924d9kde033904d43f4265@mail.gmail.com> On 10/19/06, Maciej Wisniowski wrote: > Did I miss something here?? No, I missed something: That you only wanted it done for a specific class. I thought you wanted it to happen generically. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From maciej.wisniowski at coig.katowice.pl Fri Oct 20 09:28:40 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Fri, 20 Oct 2006 09:28:40 +0200 Subject: [z3-five] Menu and MenuItem in Five In-Reply-To: <319e029f0610200014kc9924d9kde033904d43f4265@mail.gmail.com> References: <45377DB6.7010605@coig.katowice.pl> <319e029f0610190634n74bb32fr2490dc1ae1d1d2c6@mail.gmail.com> <4537D594.6020709@coig.katowice.pl> <319e029f0610200014kc9924d9kde033904d43f4265@mail.gmail.com> Message-ID: <45387AA8.10205@coig.katowice.pl> > No, I missed something: That you only wanted it done for a specific > class. I thought you wanted it to happen generically. Yes, one class - that was the point and... I just wanted to get to know how to use these directives. I'm not sure but it may be that general solution already exists in Zope 2.10. Thanks anyway! -- Maciej Wisniowski From d.schulz81 at gmx.net Fri Oct 20 10:49:29 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 20 Oct 2006 10:49:29 +0200 Subject: [z3-five] formlib default valdation msgs Message-ID: <45388D99.3080908@gmx.net> Hi, after following the steps in the tutorial http://plone.org/documentation/tutorial/using-zope-formlib-with-plone (means using the default widgets and no custom validation) The output is as attached, which looks not very nice. Is this only Plone specific? How is it possible to change the border of the validation messages? Or will it be improved with upcoming updates of the zope.app.form.browser? Thanks, Dennis -------------- next part -------------- A non-text attachment was scrubbed... Name: test.gif Type: image/gif Size: 9271 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20061020/60c7f931/attachment-0001.gif From d.schulz81 at gmx.net Fri Oct 20 10:53:13 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 20 Oct 2006 10:53:13 +0200 Subject: [z3-five] ${portal_url} not resolved in ZCML Message-ID: <45388E79.8080804@gmx.net> Hi, I tried source: http://www.serverzen.net/weblog/archive/2006/01/07/cmf-with-zope-3-on-zope-2 ${portal_url} cound not be resolved as I tried it (Plone 2.5.1, five 1.4.1) What do I have to do to have a the menu item inside the Plone Instance for example in a folder like intranet/MApplication? Thanks, Dennis From cklinger at novareto.de Fri Oct 20 10:58:05 2006 From: cklinger at novareto.de (Christian Klinger) Date: Fri, 20 Oct 2006 10:58:05 +0200 Subject: [z3-five] formlib default valdation msgs In-Reply-To: <45388D99.3080908@gmx.net> References: <45388D99.3080908@gmx.net> Message-ID: Dennis Schulz schrieb: > Hi, > > after following the steps in the tutorial > http://plone.org/documentation/tutorial/using-zope-formlib-with-plone > (means using the default widgets and no custom validation) > > The output is as attached, which looks not very nice. > Is this only Plone specific? > How is it possible to change the border of the validation messages? > Or will it be improved with upcoming updates of the zope.app.form.browser? Hi Dennis take a look at plone.app.form. http://svn.plone.org/view/plone/plone.app.form/ This package will render your formlib-fields in a more "plonish" style. Christian > > Thanks, Dennis > > > > ------------------------------------------------------------------------ > From regebro at gmail.com Fri Oct 20 12:44:55 2006 From: regebro at gmail.com (Lennart Regebro) Date: Fri, 20 Oct 2006 12:44:55 +0200 Subject: [z3-five] Menu and MenuItem in Five In-Reply-To: <45387AA8.10205@coig.katowice.pl> References: <45377DB6.7010605@coig.katowice.pl> <319e029f0610190634n74bb32fr2490dc1ae1d1d2c6@mail.gmail.com> <4537D594.6020709@coig.katowice.pl> <319e029f0610200014kc9924d9kde033904d43f4265@mail.gmail.com> <45387AA8.10205@coig.katowice.pl> Message-ID: <319e029f0610200344k71b90b29yad3ba26507ee17cb@mail.gmail.com> On 10/20/06, Maciej Wisniowski wrote: > I'm not sure but it may be that general solution already > exists in Zope 2.10. Nope. Although it could probably be an idea for 2.11. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From d.schulz81 at gmx.net Fri Oct 20 14:49:41 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 20 Oct 2006 14:49:41 +0200 Subject: [z3-five] zope.formlib with DB Message-ID: <4538C5E5.8040006@gmx.net> Hello, I am looking for an example of using zope.formlib in connection with a SQL database. (preferable SQLObject or SQLAlchemy as mapper) Means that I would have a container that doesn't look up in the ZODB but in the external database by default. Dennis From maciej.wisniowski at coig.katowice.pl Fri Oct 20 15:20:48 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Fri, 20 Oct 2006 15:20:48 +0200 Subject: [z3-five] zope.formlib with DB In-Reply-To: <4538C5E5.8040006@gmx.net> References: <4538C5E5.8040006@gmx.net> Message-ID: <4538CD30.6070301@coig.katowice.pl> > I am looking for an example of using zope.formlib in connection with a > SQL database. (preferable SQLObject or SQLAlchemy as mapper) > Means that I would have a container that doesn't look up in the ZODB but > in the external database by default. > I did something like that but with standard DB adapters. I've used setupDataWidgets function found somewhere in formlibcode that gets 'data' parameter to inject data from database. Function self.context._get_data() in the example below returns data from db. from Products.Five.formlib.formbase import Form class TemplateFormlibForm(Form): """ testing formlib """ prefix = 'tfl' form_fields = form.Fields(ITemplateFormlib) def setUpWidgets(self, ignore_request=True): self.adapters = {} self.widgets = setUpDataWidgets( form_fields=self.form_fields, form_prefix=self.prefix, context=self.context, request=self.request, data=self.context._get_data(), ignore_request=ignore_request) -- Maciej Wisniowski From philipp at weitershausen.de Fri Oct 20 15:27:33 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Fri, 20 Oct 2006 15:27:33 +0200 Subject: [z3-five] interaction and Five1.5 In-Reply-To: <1161264678.7582.5.camel@localhost.localdomain> References: <1161264678.7582.5.camel@localhost.localdomain> Message-ID: <4538CEC5.7020502@weitershausen.de> Nikolay Kim wrote: > Seems that five 1.5 doesn't install interaction object for zope3? or i > miss something? Yes, you're right. Five <1.4 set up a new "Five" interaction during five:traversable-based traversal. Five 1.5 doesn't do this anymore because traversal is now in Zope 2. In Zope 2.10, the ZPublisher should create the interaction when a new request is started, and it should end it around the same time it commits the database transaction. Patches are welcome :) People who could review the patch and apply it would also be welcome, I don't think I'll have time this or next month. Philipp From d.schulz81 at gmx.net Fri Oct 20 16:11:15 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 20 Oct 2006 16:11:15 +0200 Subject: [z3-five] zope.formlib with DB Message-ID: <4538D903.8010302@gmx.net> Thanks I will try it -------- Original-Nachricht -------- Datum: Fri, 20 Oct 2006 15:20:48 +0200 Von: Maciej Wisniowski An: d.schulz81 at gmx.net Betreff: Re: [z3-five] zope.formlib with DB > > > I am looking for an example of using zope.formlib in connection with a > > SQL database. (preferable SQLObject or SQLAlchemy as mapper) > > Means that I would have a container that doesn't look up in the ZODB but > > in the external database by default. > > > I did something like that but with standard DB adapters. > I've used setupDataWidgets function found somewhere > in formlibcode that gets 'data' parameter to inject data > >from database. Function self.context._get_data() > in the example below returns data from db. > > > >from Products.Five.formlib.formbase import Form > > class TemplateFormlibForm(Form): > """ testing formlib > """ > prefix = 'tfl' > form_fields = form.Fields(ITemplateFormlib) > > def setUpWidgets(self, ignore_request=True): > self.adapters = {} > self.widgets = setUpDataWidgets( > form_fields=self.form_fields, > form_prefix=self.prefix, > context=self.context, > request=self.request, > data=self.context._get_data(), > ignore_request=ignore_request) > > > -- > Maciej Wisniowski Re: [z3-five] zope.formlib with DB From d.schulz81 at gmx.net Fri Oct 20 17:29:45 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 20 Oct 2006 17:29:45 +0200 Subject: [z3-five] integrate a zope 3 site into plone menu structure via zcml Message-ID: <4538EB69.7010106@gmx.net> Hi, I want to integrate my page "addPR.html" into the Plone menu system in the folder ${portal_url}/PRSYSTEM/addPR.html But It does not seem to work. Can you help me to get it run? From tseaver at palladion.com Fri Oct 20 17:35:26 2006 From: tseaver at palladion.com (Tres Seaver) Date: Fri, 20 Oct 2006 11:35:26 -0400 Subject: [z3-five] integrate a zope 3 site into plone menu structure via zcml In-Reply-To: <4538EB69.7010106@gmx.net> References: <4538EB69.7010106@gmx.net> Message-ID: <4538ECBE.1090408@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dennis Schulz wrote: > Hi, > > I want to integrate my page "addPR.html" into the Plone menu system in > the folder ${portal_url}/PRSYSTEM/addPR.html > But It does not seem to work. > Can you help me to get it run? > > title="lalilu" > id="my_menu" > /> > > class=".browser.PurchaseRequisitionContentAddForm" > name="addPR.html" > permission="zope.Public" > for="*" > menu="my_menu" > title="DDDDDDDDDDDD" > /> > > for=".interfaces.IPurchaseRequisitionContent" > menu="my_menu" > title="MENUITEMMENUITEM" > action="${portal_url}/PRSYSTEM/addPR.html" > permission="zope.Public" > /> Plone isn't going to look at those menu items by default: you need to use the CMF "actions" machinery to expose your view. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFOOy9+gerLs4ltQ4RAsTfAKCsTXeO1YLxuWpg8McUNV0PdPbwswCfY8is Ai6758RZQRLY2Vi9q1tgDLI= =GGLf -----END PGP SIGNATURE----- From rocky at serverzen.com Fri Oct 20 17:58:44 2006 From: rocky at serverzen.com (Rocky Burt) Date: Fri, 20 Oct 2006 13:28:44 -0230 Subject: [z3-five] integrate a zope 3 site into plone menu structure via zcml In-Reply-To: <4538EB69.7010106@gmx.net> References: <4538EB69.7010106@gmx.net> Message-ID: <1161359922.6041.59.camel@localhost> On Fri, 2006-20-10 at 17:29 +0200, Dennis Schulz wrote: > I want to integrate my page "addPR.html" into the Plone menu system in > the folder ${portal_url}/PRSYSTEM/addPR.html > But It does not seem to work. At this point Plone (in it's default nature) does not look, use, or hook into the zope3 menu system at all. But this is something being looked at and Plone 3.0 will offer some support in this regard. In the meantime you might want to look at the CMFonFive product which will provide CMF actions representative the zope 3 menu's defined. The mapping is: menu <-> action category menuItem <-> action So to add an item to the plone action's dropdown for example, you could define a menu with the name "object_buttons" (which is the action category the actions dropdown uses) and then create a menuItem mapping to that menu. Of course be sure to quickinstall the CMFonFive tool into your Plone site. Hope this helps. Regards, Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061020/1505cb95/attachment.pgp From rocky at serverzen.com Fri Oct 20 18:02:28 2006 From: rocky at serverzen.com (Rocky Burt) Date: Fri, 20 Oct 2006 13:32:28 -0230 Subject: [z3-five] ${portal_url} not resolved in ZCML In-Reply-To: <45388E79.8080804@gmx.net> References: <45388E79.8080804@gmx.net> Message-ID: <1161360146.6041.63.camel@localhost> On Fri, 2006-20-10 at 10:53 +0200, Dennis Schulz wrote: > Hi, > > I tried > > title="user" > id="user" > /> > > for="*" > menu="user" > title="Manage Hours" > action="${portal_url}/multiplehours.html" > permission="zope2.View" > /> > > > source: > http://www.serverzen.net/weblog/archive/2006/01/07/cmf-with-zope-3-on-zope-2 > > ${portal_url} cound not be resolved as I tried it > (Plone 2.5.1, five 1.4.1) > What do I have to do to have a the menu item inside the Plone Instance > for example in a folder like intranet/MApplication? Depends on how you're trying to access the menu item. To the normal Zope 3 machinery, it has no way to convert ${portal_url} to anything. But with CMFonFive installed where menu items get converted to CMF actions... Plone will parse those actions and replace ${portal_url} with the appropriate url. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061020/64663635/attachment-0001.pgp From rocky at serverzen.com Fri Oct 20 18:03:25 2006 From: rocky at serverzen.com (Rocky Burt) Date: Fri, 20 Oct 2006 13:33:25 -0230 Subject: [z3-five] formlib default valdation msgs In-Reply-To: References: <45388D99.3080908@gmx.net> Message-ID: <1161360203.6041.65.camel@localhost> On Fri, 2006-20-10 at 10:58 +0200, Christian Klinger wrote: > Dennis Schulz schrieb: > > Hi, > > > > after following the steps in the tutorial > > http://plone.org/documentation/tutorial/using-zope-formlib-with-plone > > (means using the default widgets and no custom validation) > > > > The output is as attached, which looks not very nice. > > Is this only Plone specific? > > How is it possible to change the border of the validation messages? > > Or will it be improved with upcoming updates of the zope.app.form.browser? > > > Hi Dennis > > take a look at plone.app.form. > > http://svn.plone.org/view/plone/plone.app.form/ > > This package will render your formlib-fields in a more "plonish" style. Keep in mind plone.app.form is a little in flux at the moment. But yeah, we're basically using this as the landing place for all code that makes formlib as usable as possible in a Plone environment. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061020/2963b188/attachment.pgp From fafhrd at datacom.kz Sat Oct 21 13:39:52 2006 From: fafhrd at datacom.kz (Nikolay Kim) Date: Sat, 21 Oct 2006 17:39:52 +0600 Subject: [z3-five] interaction and Five1.5 In-Reply-To: <4538CEC5.7020502@weitershausen.de> References: <1161264678.7582.5.camel@localhost.localdomain> <4538CEC5.7020502@weitershausen.de> Message-ID: <1161430792.11119.10.camel@localhost.localdomain> Hi, Here patch that adds z3 security interaction. where should i submit it? -------------- next part -------------- A non-text attachment was scrubbed... Name: securitypolicy.diff Type: text/x-patch Size: 3519 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20061021/b989262b/attachment.bin From D.Schulz81 at gmx.net Sat Oct 21 18:16:43 2006 From: D.Schulz81 at gmx.net (Dennis Schulz) Date: Sat, 21 Oct 2006 18:16:43 +0200 Subject: [z3-five] Error with CMFonFive In-Reply-To: <20061021152518.321800@gmx.net> References: <4538EB69.7010106@gmx.net> <4538ECBE.1090408@palladion.com> <20061021152518.321800@gmx.net> Message-ID: <20061021161643.321830@gmx.net> Hi, I had the following error when I tried to install the CMSonFive Product on the Plone site via the Quickinstaller. Specification: Plone 2.5.1 Zope 2.9.5 CMS 1.6.2 Five 1.4.1 Now I can't do anything on my plone site. I always get this Error when I try to access anything on the Plone site. How can I fix this? Dennis > Traceback (innermost last): > > * Module ZPublisher.Publish, line 196, in publish_module_standard > * Module Products.PlacelessTranslationService.PatchStringIO, line 34, > in new_publish > * Module ZPublisher.Publish, line 146, in publish > * Module Zope2.App.startup, line 222, in zpublisher_exception_hook > * Module ZPublisher.Publish, line 115, in publish > * Module ZPublisher.mapply, line 88, in mapply > * Module ZPublisher.Publish, line 41, in call_object > * Module Shared.DC.Scripts.Bindings, line 311, in __call__ > * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec > * Module Products.CMFCore.FSPageTemplate, line 195, in _exec > * Module Products.CacheSetup.patch_cmf, line 18, in FSPT_pt_render > * Module Products.CacheSetup.patch_utils, line 9, in call_pattern > * Module Products.CMFCore.FSPageTemplate, line 134, in pt_render > * Module Products.CacheSetup.patch_cmf, line 56, in PT_pt_render > * Module Products.CacheSetup.patch_utils, line 9, in call_pattern > * Module Products.PageTemplates.PageTemplate, line 104, in pt_render > > * Module TAL.TALInterpreter, line 238, in __call__ > * Module TAL.TALInterpreter, line 281, in interpret > * Module TAL.TALInterpreter, line 749, in do_useMacro > * Module TAL.TALInterpreter, line 281, in interpret > * Module TAL.TALInterpreter, line 457, in do_optTag_tal > * Module TAL.TALInterpreter, line 442, in do_optTag > * Module TAL.TALInterpreter, line 437, in no_tag > * Module TAL.TALInterpreter, line 281, in interpret > * Module TAL.TALInterpreter, line 749, in do_useMacro > * Module TAL.TALInterpreter, line 281, in interpret > * Module TAL.TALInterpreter, line 457, in do_optTag_tal > * Module TAL.TALInterpreter, line 442, in do_optTag > * Module TAL.TALInterpreter, line 437, in no_tag > * Module TAL.TALInterpreter, line 281, in interpret > * Module TAL.TALInterpreter, line 749, in do_useMacro > * Module TAL.TALInterpreter, line 281, in interpret > * Module TAL.TALInterpreter, line 507, in do_setLocal_tal > * Module Products.PageTemplates.TALES, line 221, in evaluate > URL: file:CMFPlone/skins/plone_templates/global_defines.pt > Line 3, Column 0 > Expression: standard:'plone_view/globalize' > Names: > > {'container': , > 'context': , > 'default': 0x017F5300>, > 'here': , > 'loop': 0x058CF6C0>, > 'modules': > , > 'nothing': None, > 'options': {'args': ()}, > 'repeat': 0x058CF6C0>, > 'request': URL=http://localhost:99/prefs_install_products_form>, > 'root': , > 'template': , > 'traverse_subpath': [], > 'user': } > > * Module Products.PageTemplates.Expressions, line 185, in __call__ > * Module Products.PageTemplates.Expressions, line 180, in _eval > * Module Products.PageTemplates.Expressions, line 85, in render > * Module Products.CMFPlone.browser.plone, line 66, in globalize > * Module Products.CMFPlone.browser.plone, line 118, in _initializeData > * Module Products.CMFPlone.ActionsTool, line 46, in > listFilteredActionsFor > * Module Products.CMFPlone.ActionsTool, line 34, in _getActions > * Module Products.CMFCore.ActionProviderBase, line 86, in > listActionInfos > * Module Products.CMFonFive.fiveactionstool, line 98, in listActions > * Module Products.CMFonFive.fiveactionstool, line 49, in getMenu > > NameError: global name 'Interface' is not defined (Also, the following > error occurred while attempting to render the standard error message, please > see the event log for full details: global name 'Interface' is not defined) > -- > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Plone-Users mailing list > Plone-Users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/plone-users -- GMX DSL-Flatrate 0,- Euro* - ?berall, wo DSL verf?gbar ist! NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl From D.Schulz81 at gmx.net Sat Oct 21 18:35:00 2006 From: D.Schulz81 at gmx.net (Dennis Schulz) Date: Sat, 21 Oct 2006 18:35:00 +0200 Subject: [z3-five] Error with CMFonFive In-Reply-To: <20061021161643.321830@gmx.net> References: <4538EB69.7010106@gmx.net> <4538ECBE.1090408@palladion.com> <20061021152518.321800@gmx.net> <20061021161643.321830@gmx.net> Message-ID: <20061021163500.321810@gmx.net> The version of CMFonFive is 1.3.3 > Hi, > > I had the following error when I tried to install the CMSonFive Product on > the Plone site via the Quickinstaller. > > > Specification: > Plone 2.5.1 > Zope 2.9.5 > CMS 1.6.2 > Five 1.4.1 > > Now I can't do anything on my plone site. I always get this Error when I > try to access anything on the Plone site. How can I fix this? > > Dennis > > > > Traceback (innermost last): > > > > * Module ZPublisher.Publish, line 196, in publish_module_standard > > * Module Products.PlacelessTranslationService.PatchStringIO, line > 34, > > in new_publish > > * Module ZPublisher.Publish, line 146, in publish > > * Module Zope2.App.startup, line 222, in zpublisher_exception_hook > > * Module ZPublisher.Publish, line 115, in publish > > * Module ZPublisher.mapply, line 88, in mapply > > * Module ZPublisher.Publish, line 41, in call_object > > * Module Shared.DC.Scripts.Bindings, line 311, in __call__ > > * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec > > * Module Products.CMFCore.FSPageTemplate, line 195, in _exec > > * Module Products.CacheSetup.patch_cmf, line 18, in FSPT_pt_render > > * Module Products.CacheSetup.patch_utils, line 9, in call_pattern > > * Module Products.CMFCore.FSPageTemplate, line 134, in pt_render > > * Module Products.CacheSetup.patch_cmf, line 56, in PT_pt_render > > * Module Products.CacheSetup.patch_utils, line 9, in call_pattern > > * Module Products.PageTemplates.PageTemplate, line 104, in pt_render > > > > * Module TAL.TALInterpreter, line 238, in __call__ > > * Module TAL.TALInterpreter, line 281, in interpret > > * Module TAL.TALInterpreter, line 749, in do_useMacro > > * Module TAL.TALInterpreter, line 281, in interpret > > * Module TAL.TALInterpreter, line 457, in do_optTag_tal > > * Module TAL.TALInterpreter, line 442, in do_optTag > > * Module TAL.TALInterpreter, line 437, in no_tag > > * Module TAL.TALInterpreter, line 281, in interpret > > * Module TAL.TALInterpreter, line 749, in do_useMacro > > * Module TAL.TALInterpreter, line 281, in interpret > > * Module TAL.TALInterpreter, line 457, in do_optTag_tal > > * Module TAL.TALInterpreter, line 442, in do_optTag > > * Module TAL.TALInterpreter, line 437, in no_tag > > * Module TAL.TALInterpreter, line 281, in interpret > > * Module TAL.TALInterpreter, line 749, in do_useMacro > > * Module TAL.TALInterpreter, line 281, in interpret > > * Module TAL.TALInterpreter, line 507, in do_setLocal_tal > > * Module Products.PageTemplates.TALES, line 221, in evaluate > > URL: file:CMFPlone/skins/plone_templates/global_defines.pt > > Line 3, Column 0 > > Expression: standard:'plone_view/globalize' > > Names: > > > > {'container': , > > 'context': , > > 'default': > 0x017F5300>, > > 'here': , > > 'loop': > 0x058CF6C0>, > > 'modules': > > 0x017E1850>, > > 'nothing': None, > > 'options': {'args': ()}, > > 'repeat': > 0x058CF6C0>, > > 'request': > URL=http://localhost:99/prefs_install_products_form>, > > 'root': , > > 'template': /Plone/prefs_install_products_form>, > > 'traverse_subpath': [], > > 'user': } > > > > * Module Products.PageTemplates.Expressions, line 185, in __call__ > > * Module Products.PageTemplates.Expressions, line 180, in _eval > > * Module Products.PageTemplates.Expressions, line 85, in render > > * Module Products.CMFPlone.browser.plone, line 66, in globalize > > * Module Products.CMFPlone.browser.plone, line 118, in > _initializeData > > * Module Products.CMFPlone.ActionsTool, line 46, in > > listFilteredActionsFor > > * Module Products.CMFPlone.ActionsTool, line 34, in _getActions > > * Module Products.CMFCore.ActionProviderBase, line 86, in > > listActionInfos > > * Module Products.CMFonFive.fiveactionstool, line 98, in listActions > > * Module Products.CMFonFive.fiveactionstool, line 49, in getMenu > > > > NameError: global name 'Interface' is not defined (Also, the following > > error occurred while attempting to render the standard error message, > please > > see the event log for full details: global name 'Interface' is not > defined) > > -- > > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > > Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer > > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, > security? > > Get stuff done quickly with pre-integrated technology to make your job > > easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > _______________________________________________ > > Plone-Users mailing list > > Plone-Users at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/plone-users > > -- > GMX DSL-Flatrate 0,- Euro* - ?berall, wo DSL verf?gbar ist! > NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five -- GMX DSL-Flatrate 0,- Euro* - ?berall, wo DSL verf?gbar ist! NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl From philipp at weitershausen.de Sat Oct 21 18:51:35 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sat, 21 Oct 2006 18:51:35 +0200 Subject: [z3-five] interaction and Five1.5 In-Reply-To: <1161430792.11119.10.camel@localhost.localdomain> References: <1161264678.7582.5.camel@localhost.localdomain> <4538CEC5.7020502@weitershausen.de> <1161430792.11119.10.camel@localhost.localdomain> Message-ID: <453A5017.5090206@weitershausen.de> Nikolay Kim wrote: > Here patch that adds z3 security interaction. Thanks! > where should i submit it? There might already be a related issue in the Zope tracker (I don't remember exactly). If not, please create one and attach the patch. A few comments before you do, though: - Please write a few tests that demonstrate the patch's additional behaviour. - Any reason why you didn't you use Products.Five.security.FiveSecurityPolicy? If it's useless, we should deprecate it... From D.Schulz81 at gmx.net Sat Oct 21 18:53:16 2006 From: D.Schulz81 at gmx.net (Dennis Schulz) Date: Sat, 21 Oct 2006 18:53:16 +0200 Subject: [z3-five] Error with CMFonFive In-Reply-To: <20061021163500.321810@gmx.net> References: <4538EB69.7010106@gmx.net> <4538ECBE.1090408@palladion.com> <20061021152518.321800@gmx.net> <20061021161643.321830@gmx.net> <20061021163500.321810@gmx.net> Message-ID: <20061021165316.321830@gmx.net> Ok the realease 1.3.2 seems to work. Dennis -------- Original-Nachricht -------- Datum: Sat, 21 Oct 2006 18:35:00 +0200 Von: "Dennis Schulz" An: z3-five at codespeak.net Betreff: Re: [z3-five] Error with CMFonFive > The version of CMFonFive is 1.3.3 > > > > Hi, > > > > I had the following error when I tried to install the CMSonFive Product > on > > the Plone site via the Quickinstaller. > > > > > > Specification: > > Plone 2.5.1 > > Zope 2.9.5 > > CMS 1.6.2 > > Five 1.4.1 > > > > Now I can't do anything on my plone site. I always get this Error when I > > try to access anything on the Plone site. How can I fix this? > > > > Dennis > > > > > > > Traceback (innermost last): > > > > > > * Module ZPublisher.Publish, line 196, in publish_module_standard > > > * Module Products.PlacelessTranslationService.PatchStringIO, line > > 34, > > > in new_publish > > > * Module ZPublisher.Publish, line 146, in publish > > > * Module Zope2.App.startup, line 222, in zpublisher_exception_hook > > > * Module ZPublisher.Publish, line 115, in publish > > > * Module ZPublisher.mapply, line 88, in mapply > > > * Module ZPublisher.Publish, line 41, in call_object > > > * Module Shared.DC.Scripts.Bindings, line 311, in __call__ > > > * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec > > > * Module Products.CMFCore.FSPageTemplate, line 195, in _exec > > > * Module Products.CacheSetup.patch_cmf, line 18, in FSPT_pt_render > > > * Module Products.CacheSetup.patch_utils, line 9, in call_pattern > > > * Module Products.CMFCore.FSPageTemplate, line 134, in pt_render > > > * Module Products.CacheSetup.patch_cmf, line 56, in PT_pt_render > > > * Module Products.CacheSetup.patch_utils, line 9, in call_pattern > > > * Module Products.PageTemplates.PageTemplate, line 104, in > pt_render > > > > > > * Module TAL.TALInterpreter, line 238, in __call__ > > > * Module TAL.TALInterpreter, line 281, in interpret > > > * Module TAL.TALInterpreter, line 749, in do_useMacro > > > * Module TAL.TALInterpreter, line 281, in interpret > > > * Module TAL.TALInterpreter, line 457, in do_optTag_tal > > > * Module TAL.TALInterpreter, line 442, in do_optTag > > > * Module TAL.TALInterpreter, line 437, in no_tag > > > * Module TAL.TALInterpreter, line 281, in interpret > > > * Module TAL.TALInterpreter, line 749, in do_useMacro > > > * Module TAL.TALInterpreter, line 281, in interpret > > > * Module TAL.TALInterpreter, line 457, in do_optTag_tal > > > * Module TAL.TALInterpreter, line 442, in do_optTag > > > * Module TAL.TALInterpreter, line 437, in no_tag > > > * Module TAL.TALInterpreter, line 281, in interpret > > > * Module TAL.TALInterpreter, line 749, in do_useMacro > > > * Module TAL.TALInterpreter, line 281, in interpret > > > * Module TAL.TALInterpreter, line 507, in do_setLocal_tal > > > * Module Products.PageTemplates.TALES, line 221, in evaluate > > > URL: file:CMFPlone/skins/plone_templates/global_defines.pt > > > Line 3, Column 0 > > > Expression: standard:'plone_view/globalize' > > > Names: > > > > > > {'container': , > > > 'context': , > > > 'default': > > 0x017F5300>, > > > 'here': , > > > 'loop': > > 0x058CF6C0>, > > > 'modules': > > > > 0x017E1850>, > > > 'nothing': None, > > > 'options': {'args': ()}, > > > 'repeat': > > 0x058CF6C0>, > > > 'request': > > URL=http://localhost:99/prefs_install_products_form>, > > > 'root': , > > > 'template': > /Plone/prefs_install_products_form>, > > > 'traverse_subpath': [], > > > 'user': } > > > > > > * Module Products.PageTemplates.Expressions, line 185, in __call__ > > > * Module Products.PageTemplates.Expressions, line 180, in _eval > > > * Module Products.PageTemplates.Expressions, line 85, in render > > > * Module Products.CMFPlone.browser.plone, line 66, in globalize > > > * Module Products.CMFPlone.browser.plone, line 118, in > > _initializeData > > > * Module Products.CMFPlone.ActionsTool, line 46, in > > > listFilteredActionsFor > > > * Module Products.CMFPlone.ActionsTool, line 34, in _getActions > > > * Module Products.CMFCore.ActionProviderBase, line 86, in > > > listActionInfos > > > * Module Products.CMFonFive.fiveactionstool, line 98, in > listActions > > > * Module Products.CMFonFive.fiveactionstool, line 49, in getMenu > > > > > > NameError: global name 'Interface' is not defined (Also, the following > > > error occurred while attempting to render the standard error message, > > please > > > see the event log for full details: global name 'Interface' is not > > defined) > > > -- > > > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > > > Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer > > > > > > > > > ------------------------------------------------------------------------- > > > Using Tomcat but need to do more? Need to support web services, > > security? > > > Get stuff done quickly with pre-integrated technology to make your job > > > easier > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > > Geronimo > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > _______________________________________________ > > > Plone-Users mailing list > > > Plone-Users at lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/plone-users > > > > -- > > GMX DSL-Flatrate 0,- Euro* - ?berall, wo DSL verf?gbar ist! > > NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl > > _______________________________________________ > > z3-five mailing list > > z3-five at codespeak.net > > http://codespeak.net/mailman/listinfo/z3-five > > -- > GMX DSL-Flatrate 0,- Euro* - ?berall, wo DSL verf?gbar ist! > NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal f?r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer From tseaver at palladion.com Tue Oct 24 13:29:21 2006 From: tseaver at palladion.com (Tres Seaver) Date: Tue, 24 Oct 2006 07:29:21 -0400 Subject: [z3-five] Zope Tests: 8 OK, 1 Failed In-Reply-To: <200610241000.k9OA09OP017366@shnoll.test.at> References: <200610241000.k9OA09OP017366@shnoll.test.at> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Zope Tests Summarizer wrote: > Test failures > ------------- > > Subject: FAILED (errors=1) : Zope-trunk Python-2.4.3 : Linux > From: Zope Unit Tests > Date: Mon Oct 23 21:35:18 EDT 2006 > URL: http://mail.zope.org/pipermail/zope-tests/2006-October/006371.html First, thanks for resuming this collected report. I would much rather have links directly to the broken test run than to the buildbot page. Second, I can reproduce the failure on my machine, at least after an 'svn up' this morning, but have no obvious clue why it would be broken: the code for local site stuff in Five hasn't changed since May. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFPfkR+gerLs4ltQ4RAtglAJ0QxuTiRj7TIDgm8YNFJWyGVgTlLgCgx3g5 4MpiZcsh0pRpuIYr6zLmm2c= =Bqcs -----END PGP SIGNATURE----- From y.2006_ at wcm-solutions.de Tue Oct 24 14:04:38 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Tue, 24 Oct 2006 14:04:38 +0200 Subject: [z3-five] Zope Tests: 8 OK, 1 Failed In-Reply-To: References: <200610241000.k9OA09OP017366@shnoll.test.at> Message-ID: <453E0156.8030505@wcm-solutions.de> Tres Seaver wrote: >> Test failures >> ------------- >> >> Subject: FAILED (errors=1) : Zope-trunk Python-2.4.3 : Linux >> From: Zope Unit Tests >> Date: Mon Oct 23 21:35:18 EDT 2006 >> URL: http://mail.zope.org/pipermail/zope-tests/2006-October/006371.html > > First, thanks for resuming this collected report. I would much rather > have links directly to the broken test run than to the buildbot page. > > Second, I can reproduce the failure on my machine, at least after an > 'svn up' this morning, but have no obvious clue why it would be broken: > the code for local site stuff in Five hasn't changed since May. The failure showed up after this checkin: http://svn.zope.org/?rev=70383&view=rev But I didn't have time to track it down, so I opened this collector issue: http://www.zope.org/Collectors/Zope/2198 Cheers, Yuppie From jinty at web.de Fri Oct 27 10:43:19 2006 From: jinty at web.de (Brian Sutherland) Date: Fri, 27 Oct 2006 10:43:19 +0200 Subject: [z3-five] Patch to enable recursive resourceDirectory support In-Reply-To: <1160282352.21623.1.camel@ubuntu> References: <1155769999.24847.27.camel@ubuntu> <44E3EE1D.3060500@weitershausen.de> <1155789556.11292.3.camel@ubuntu> <1160282352.21623.1.camel@ubuntu> Message-ID: <20061027084319.GA6446@minipas.home> On Sun, Oct 08, 2006 at 05:39:12PM +1300, Richard Waid wrote: > On Thu, 2006-08-17 at 16:39 +1200, Richard Waid wrote: > > On Thu, 2006-08-17 at 06:18 +0200, Philipp von Weitershausen wrote: > > > Richard Waid wrote: > > > > I noticed that the resourceDirectory directive isn't recursive as it is > > > > in Zope3, so I backported the behaviour from Zope3. The patch is > > > > attached. > > > > > > Hey, thanks for the patch. Can you also provide a short unit test for > > > this (extending an existing one should be enough)? Then we can include > > > this patch right away. > > > > Sure: > > > > Just following up on this one, did the recursive support get merged? Thanks, I found your patch very useful in my last project and have just merged a minimal version of it. -- Brian Sutherland Metropolis - "it's the first movie with a robot. And she's a woman. And she's EVIL!!" From richard at iopen.net Sat Oct 28 10:00:45 2006 From: richard at iopen.net (Richard Waid) Date: Sat, 28 Oct 2006 21:00:45 +1300 Subject: [z3-five] Patch to enable recursive resourceDirectory support In-Reply-To: <20061027084319.GA6446@minipas.home> References: <1155769999.24847.27.camel@ubuntu> <44E3EE1D.3060500@weitershausen.de> <1155789556.11292.3.camel@ubuntu> <1160282352.21623.1.camel@ubuntu> <20061027084319.GA6446@minipas.home> Message-ID: <1162022445.5861.16.camel@richard-laptop> On Fri, 2006-10-27 at 10:43 +0200, Brian Sutherland wrote: > On Sun, Oct 08, 2006 at 05:39:12PM +1300, Richard Waid wrote: > > Just following up on this one, did the recursive support get merged? > > Thanks, I found your patch very useful in my last project and have just > merged a minimal version of it. Thanks Brian, most appreciated. --Richard From philipp at weitershausen.de Sat Oct 28 23:50:36 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sat, 28 Oct 2006 23:50:36 +0200 Subject: [z3-five] Zope Tests: 8 OK, 1 Failed In-Reply-To: <453E0156.8030505@wcm-solutions.de> References: <200610241000.k9OA09OP017366@shnoll.test.at> <453E0156.8030505@wcm-solutions.de> Message-ID: <4543D0AC.5070804@weitershausen.de> yuppie wrote: > Tres Seaver wrote: >>> Test failures >>> ------------- >>> >>> Subject: FAILED (errors=1) : Zope-trunk Python-2.4.3 : Linux >>> From: Zope Unit Tests >>> Date: Mon Oct 23 21:35:18 EDT 2006 >>> URL: http://mail.zope.org/pipermail/zope-tests/2006-October/006371.html >> First, thanks for resuming this collected report. I would much rather >> have links directly to the broken test run than to the buildbot page. >> >> Second, I can reproduce the failure on my machine, at least after an >> 'svn up' this morning, but have no obvious clue why it would be broken: >> the code for local site stuff in Five hasn't changed since May. > > The failure showed up after this checkin: > http://svn.zope.org/?rev=70383&view=rev > > But I didn't have time to track it down, so I opened this collector > issue: http://www.zope.org/Collectors/Zope/2198 OMG, why are we using the 3.3 branch HEAD on the 2.10 branch??? This is how Stephan's fix got pulled into Zope 2 automatically and *automatically broke* Zope 2. It also broke Five trunk for some reason (the formlib stuff). Obviously, this is bad. We should stick to specific revisions or tags when pointing to externals. Pointing to HEAD of a branch or trunk is insane as it's an uncontrollable risk. Philipp From sean.upton at uniontrib.com Sun Oct 29 01:04:29 2006 From: sean.upton at uniontrib.com (sean.upton at uniontrib.com) Date: Sat, 28 Oct 2006 16:04:29 -0700 Subject: [z3-five] Missing errors package in 1.4 branch formlib r70910 Message-ID: <2DBD6171D5E06F4E9B783D6E8E0DD8A8010C0D5A@DESI.hollywood.sduniontrib.com> Bug/breakage possibility on the Five 1.4 branch: formlib/configure.zcml for Five 1.4 branch r70910 references an 'errors' package that doesn't exist: The 1.4 branch works as of r70909, but breaks running Plone 2.5/Zope 2.9.x for me - zopectl fg stops. I suspect that yuppie might have such an errors package in a working copy? Sean +----------------------------------------------------------+ Sean Upton SignOnSanDiego.com Site Technology Supervisor The San Diego Union-Tribune 619.718.5241 sean.upton at signonsandiego.com 350 Camino De La Reina San Diego, CA 92108 Plone Powered! plone.org ++ python.org ++ zope.org +----------------------------------------------------------+ From lists at zopyx.com Sun Oct 29 01:43:19 2006 From: lists at zopyx.com (Andreas Jung) Date: Sat, 28 Oct 2006 16:43:19 -0700 Subject: [z3-five] [Zope-dev] Re: Zope Tests: 8 OK, 1 Failed In-Reply-To: <4543D0AC.5070804@weitershausen.de> References: <200610241000.k9OA09OP017366@shnoll.test.at> <453E0156.8030505@wcm-solutions.de> <4543D0AC.5070804@weitershausen.de> Message-ID: <675009FC66F9441B3C97E5EF@suxmac.local> --On 28. Oktober 2006 23:50:36 +0200 Philipp von Weitershausen wrote: > > OMG, why are we using the 3.3 branch HEAD on the 2.10 branch??? This is > how Stephan's fix got pulled into Zope 2 automatically and *automatically > broke* Zope 2. It also broke Five trunk for some reason (the formlib > stuff). Obviously, this is bad. > > We should stick to specific revisions or tags when pointing to externals. > Pointing to HEAD of a branch or trunk is insane as it's an uncontrollable > risk. > As discussed with you: I will change the externals on the 2.10 branch to the related 3.3 tag. Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20061028/cdd112ef/attachment.pgp From rocky at serverzen.com Sun Oct 29 06:00:55 2006 From: rocky at serverzen.com (Rocky Burt) Date: Sat, 28 Oct 2006 22:00:55 -0700 Subject: [z3-five] Missing errors package in 1.4 branch formlib r70910 In-Reply-To: <2DBD6171D5E06F4E9B783D6E8E0DD8A8010C0D5A@DESI.hollywood.sduniontrib.com> References: <2DBD6171D5E06F4E9B783D6E8E0DD8A8010C0D5A@DESI.hollywood.sduniontrib.com> Message-ID: <1162098051.10331.2.camel@localhost> On Sat, 2006-28-10 at 16:04 -0700, sean.upton at uniontrib.com wrote: > Bug/breakage possibility on the Five 1.4 branch: > > formlib/configure.zcml for Five 1.4 branch r70910 references an 'errors' > package that doesn't exist: > > factory=".errors.InvalidErrorView" > permission="zope.Public" > /> > > The 1.4 branch works as of r70909, but breaks running Plone 2.5/Zope > 2.9.x for me - zopectl fg stops. I suspect that yuppie might have such > an errors package in a working copy? My suspicion is that Zope 2.9 svn branch has added this errors package/module and r70909 and higher of Five 1.4 branch requires this. If this is the case, then it's probably ok for Five 1.4 svn to depend on Zope 2.9 svn. Although I would have liked to have seen (which I myself was planning on releasing) a Five 1.4.2 that ran on earlier Zope 2.9. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061028/5833391f/attachment.pgp From y.2006_ at wcm-solutions.de Sun Oct 29 10:06:42 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sun, 29 Oct 2006 10:06:42 +0100 Subject: [z3-five] [Zope-dev] Re: Zope Tests: 8 OK, 1 Failed In-Reply-To: <675009FC66F9441B3C97E5EF@suxmac.local> References: <200610241000.k9OA09OP017366@shnoll.test.at> <453E0156.8030505@wcm-solutions.de> <4543D0AC.5070804@weitershausen.de> <675009FC66F9441B3C97E5EF@suxmac.local> Message-ID: <45446F22.3040902@wcm-solutions.de> Hi Andreas! Hi Philipp! Andreas Jung wrote: > > --On 28. Oktober 2006 23:50:36 +0200 Philipp von Weitershausen > wrote: >> >> OMG, why are we using the 3.3 branch HEAD on the 2.10 branch??? This is >> how Stephan's fix got pulled into Zope 2 automatically and *automatically >> broke* Zope 2. It also broke Five trunk for some reason (the formlib >> stuff). Obviously, this is bad. >> >> We should stick to specific revisions or tags when pointing to externals. >> Pointing to HEAD of a branch or trunk is insane as it's an uncontrollable >> risk. >> > > As discussed with you: I will change the externals on the 2.10 branch to > the related 3.3 tag. Oops! Sorry! I did not mean to cause any confusion: - AFAICT the 2.10 branch points already to the 3.3.0 tag. - The test failure is on Zope trunk which points to the 3.3 branch HEAD. - The collector issue I opened mentions an unsupported combination (Zope 2.10 branch with Five trunk and Zope 3.3 branch). I hope there will be a Zope 3.3.1 release that will be included in Zope 2.10.1. The person who will stitch in the Zope 3.3.1 tag will see this failure and http://www.zope.org/Collectors/Zope/2198 might give a hint what the problem is. Cheers, Yuppie From y.2006_ at wcm-solutions.de Sun Oct 29 10:15:03 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sun, 29 Oct 2006 10:15:03 +0100 Subject: [z3-five] Missing errors package in 1.4 branch formlib r70910 In-Reply-To: <1162098051.10331.2.camel@localhost> References: <2DBD6171D5E06F4E9B783D6E8E0DD8A8010C0D5A@DESI.hollywood.sduniontrib.com> <1162098051.10331.2.camel@localhost> Message-ID: <45447117.6080901@wcm-solutions.de> Hi! Rocky Burt wrote: > On Sat, 2006-28-10 at 16:04 -0700, sean.upton at uniontrib.com wrote: >> Bug/breakage possibility on the Five 1.4 branch: >> >> formlib/configure.zcml for Five 1.4 branch r70910 references an 'errors' >> package that doesn't exist: >> >> > factory=".errors.InvalidErrorView" >> permission="zope.Public" >> /> >> >> The 1.4 branch works as of r70909, but breaks running Plone 2.5/Zope >> 2.9.x for me - zopectl fg stops. I suspect that yuppie might have such >> an errors package in a working copy? > > My suspicion is that Zope 2.9 svn branch has added this errors > package/module and r70909 and higher of Five 1.4 branch requires this. > If this is the case, then it's probably ok for Five 1.4 svn to depend on > Zope 2.9 svn. Although I would have liked to have seen (which I myself > was planning on releasing) a Five 1.4.2 that ran on earlier Zope 2.9. zope.formlib.errors is new in Zope 3.2.2 which ships with Zope 2.9.5. I asked on this list before making Zope 2.9.5 required: http://codespeak.net/pipermail/z3-five/2006q4/001786.html I tried to make sure that Five 1.4 branch works with the Zope 2.9.5 release and Five 1.5 branch with the Zope 2.10.0 release. Five trunk currently depends on unreleased changes on the Zope 3.3 branch. Cheers, Yuppie From regebro at gmail.com Sun Oct 29 11:36:53 2006 From: regebro at gmail.com (Lennart Regebro) Date: Sun, 29 Oct 2006 11:36:53 +0100 Subject: [z3-five] OK, I give up: Tesbrowser and layers. How? Message-ID: <319e029f0610290236r73fbbd36m2cc1733f0e69a8d@mail.gmail.com> As soon as I try to use testbrowser and layers at the same time, everything explodes. The errors I get vary from "None has no attribute _p_jar" to "shouldn't load state for 0x0C when connection is closed" to that I can't look up utilities. Which error I get seems to depend on entirely unrelated issues, and yes, the errors usually come in tests that are unrelated to the changes I make. i.e: Everything works fine. All tests run, with layers. Then I introduce one test that uses testbrowser: BAM! 24 tests give 28 errors. (Really). Or: I have a test running with testbrowser, and all is fine. I try to introduce a layer, and all stops. All with the above obscure errors. I have been digging in the internals for hours now, and I give up. Nothing of this makes any sense to me. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From lists at zopyx.com Sun Oct 29 15:04:58 2006 From: lists at zopyx.com (Andreas Jung) Date: Sun, 29 Oct 2006 07:04:58 -0700 Subject: [z3-five] [Zope-dev] Re: Zope Tests: 8 OK, 1 Failed In-Reply-To: <45446F22.3040902@wcm-solutions.de> References: <200610241000.k9OA09OP017366@shnoll.test.at> <453E0156.8030505@wcm-solutions.de> <4543D0AC.5070804@weitershausen.de> <675009FC66F9441B3C97E5EF@suxmac.local> <45446F22.3040902@wcm-solutions.de> Message-ID: --On 29. Oktober 2006 10:06:42 +0100 yuppie wrote: > > Oops! Sorry! I did not mean to cause any confusion: > > - AFAICT the 2.10 branch points already to the 3.3.0 tag. Right. However Philipp pointed out that the Zope 2 trunk uses the Zope 3 trunk right now. I pointed the reasons for using the Zope 3 trunk in a former posting. My argument for using the trunk instead of a fixed revision/tag is: when we develop against the trunk or implement something on the trunk then we want to be sure that the code also works with the latest Zope 3 changes. Otherwise something might break when we update the svn:exernals to latest Zope 3 changes at some time before an upcoming major release. So I would prefer that things break early than late. However as seen this approach has other side-effects..but I am open to let the svn:externals point to tags if you want that... Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20061029/1135f8f5/attachment.pgp From y.2006_ at wcm-solutions.de Sun Oct 29 15:41:43 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sun, 29 Oct 2006 15:41:43 +0100 Subject: [z3-five] Zope Tests: 8 OK, 1 Failed In-Reply-To: References: <200610241000.k9OA09OP017366@shnoll.test.at> <453E0156.8030505@wcm-solutions.de> <4543D0AC.5070804@weitershausen.de> <675009FC66F9441B3C97E5EF@suxmac.local> <45446F22.3040902@wcm-solutions.de> Message-ID: <4544BDA7.2030804@wcm-solutions.de> Hi! Andreas Jung wrote: > > --On 29. Oktober 2006 10:06:42 +0100 yuppie > wrote: >> >> Oops! Sorry! I did not mean to cause any confusion: >> >> - AFAICT the 2.10 branch points already to the 3.3.0 tag. > > Right. > > However Philipp pointed out that the Zope 2 trunk uses the Zope 3 trunk > right now. I pointed the reasons for using the Zope 3 trunk in a former > posting. I guess you mean 3.3 branch HEAD, not Zope 3 trunk HEAD. > My argument for using the trunk instead of a fixed revision/tag > is: > when we develop against the trunk or implement something on the trunk > then we want to be sure that the code also works with the latest Zope 3 > changes. > Otherwise something might break when we update the svn:exernals to latest > Zope 3 changes at some time before an upcoming major release. So I would > prefer that things break early than late. However as seen this approach > has other side-effects..but I am open to let the svn:externals point to > tags > if you want that... Well. I would prefer if there would be somebody who volunteers to test Zope 2 every now and then with the latest Zope 3 revision. If he or she makes sure all tests pass, the svn:externals can be updated to that revision. In the long run the issues have to be resolved anyway, so doing this step by step would not be much extra work. And we could avoid to do big last minute changes right before the release. Pointing the svn:externals to the HEAD might encourage people to volunteer for fixing the issues, but I'm afraid a broken HEAD also discourages people to contribute other changes. Just my 2 cents. Cheers, Yuppie From philipp at weitershausen.de Mon Oct 30 00:01:33 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Mon, 30 Oct 2006 00:01:33 +0100 Subject: [z3-five] RFC: The future of Products.Five Message-ID: Problem ------- A lot of us are trying to backport or create additional Zope 3-related technology in Zope 2. Whit Morriss, for instance, needs integer IDs in Five, the Plone project is heavily using local components now and will sooner or later need a more sophisticated site manager implementation than PersistentComponents. There's also the need for customizing global template-based views ("Customerize" button), something that doesn't even exist in Zope 3 yet. I don't think all of these things should go into the Products.Five anymore, for several reasons: * We're trying to get away from writing products and into writing Python packages that can e.g. be installed as eggs. * Some of these things are not essential to bringing Zope 3 technology into Zope 2 (e.g. like the intid stuff), so it may be questionable whether it should ship with Zope 2/Five out of the box. * Starting with Zope 2.10, Products.Five is actually getting smaller which is a trend I would like to continue to see. And if I manage to land my Acquisition refactoring in 2.11, Products.Five will pretty soon decrease in size tremendously, and there are also other things in Products.Five that should really be in Zope 2 proper (e.g. OFS). Proposal -------- So, what I'm proposing is to feature-freeze the Products.Five package and just basically keep making it work for future Zope versions. Five 1.6 (current trunk) will work for Zope 2.11 (current trunk), Five 1.7 for 2.12, etc. So, essentially there won't be Five feature releases in between anymore, which means we can put Products.Five into the Zope/lib/python/Products proper. New stuff will be added in standard Python packages that may or may not ship with Zope 2, Plone or whoever needs them. I personally almost don't care, it's really only about defining the right egg dependencies in Plone 3.0 or Zope 2.11, I would assume (see also 'Risks' below). This seems like the release manager's job who would include stuff based on requests from the community and package maintainer's recommendations. The namespace for these packages should probably be 'five', as we already have five.intid and five.customerize and we are, after all, the Five project. Advantages ---------- * We'll be able to use stuff we get for Python packages for free, such as installation via eggs, Cheeseshop presence and much less majyck for initialization. * Stuff that we create as part of the Five project does not necessarily have to end up in Zope 2. Currently, stuff added to Products.Five eventually always ends up in some Zope 2 release which means we'll have to maintain it forever, no matter how crappy it turns out to be (e.g. Products.Five.site). * Development of certain components can move much faster than even Five. New things like five.intid or five.customerize can be experimented with and already be in the right place if they turn out to be stable. If not, they won't harm Products.Five, either. Individual packages rather than one big one also reduces the amount of work that has to be done by the Five release manager (IOW my work ;)). Risks ----- * If five.* packages need ZCML config (and I know some will), they will either have to be included the Zope 3 way (site.zcml or package-includes slug in your instance's 'etc' directory), or we need to come up with an approach that Zope 2 people are more comfortable with. I think an egg entry point would be a compelling solution. There are plans to do this in Zope 3 even so that you can provide configuration from Python instead of ZCML. I expect this to land in Zope 3.4 which means we should be able to take advantage of it in 2.11. * It is unclear to me at this point what Zope 2's egg story will be. I *hope* that 2.11 will get the same egg story as the Zope 3.4 that ships with it does, though noone has talked about eggifying Zope 2 yet. We should probably do that. Comments welcome :) From rocky at serverzen.com Mon Oct 30 06:08:18 2006 From: rocky at serverzen.com (Rocky Burt) Date: Sun, 29 Oct 2006 21:08:18 -0800 Subject: [z3-five] RFC: The future of Products.Five In-Reply-To: References: Message-ID: <1162184897.6372.10.camel@localhost> On Mon, 2006-30-10 at 00:01 +0100, Philipp von Weitershausen wrote: > Proposal > -------- > > So, what I'm proposing is to feature-freeze the Products.Five package > and just basically keep making it work for future Zope versions. Five > 1.6 (current trunk) will work for Zope 2.11 (current trunk), Five 1.7 > for 2.12, etc. So, essentially there won't be Five feature releases in > between anymore, which means we can put Products.Five into the > Zope/lib/python/Products proper. +1 > New stuff will be added in standard Python packages that may or may not > ship with Zope 2, Plone or whoever needs them. I personally almost don't > care, it's really only about defining the right egg dependencies in > Plone 3.0 or Zope 2.11, I would assume (see also 'Risks' below). This > seems like the release manager's job who would include stuff based on > requests from the community and package maintainer's recommendations. +0 We're really not sure what the story here is yet... trying to sort things out. > The namespace for these packages should probably be 'five', as we > already have five.intid and five.customerize and we are, after all, the > Five project. +1 > Advantages > ---------- > > * We'll be able to use stuff we get for Python packages for free, such > as installation via eggs, Cheeseshop presence and much less majyck for > initialization. terrific. > * Stuff that we create as part of the Five project does not necessarily > have to end up in Zope 2. Currently, stuff added to Products.Five > eventually always ends up in some Zope 2 release which means we'll have > to maintain it forever, no matter how crappy it turns out to be (e.g. > Products.Five.site). great. > * Development of certain components can move much faster than even Five. > New things like five.intid or five.customerize can be experimented with > and already be in the right place if they turn out to be stable. If not, > they won't harm Products.Five, either. Individual packages rather than > one big one also reduces the amount of work that has to be done by the > Five release manager (IOW my work ;)). great. > Risks > ----- > > * If five.* packages need ZCML config (and I know some will), they will > either have to be included the Zope 3 way (site.zcml or package-includes > slug in your instance's 'etc' directory), or we need to come up with an > approach that Zope 2 people are more comfortable with. I think an egg > entry point would be a compelling solution. There are plans to do this > in Zope 3 even so that you can provide configuration from Python instead > of ZCML. I expect this to land in Zope 3.4 which means we should be able > to take advantage of it in 2.11. Interesting, but definitely needs more thought. > * It is unclear to me at this point what Zope 2's egg story will be. I > *hope* that 2.11 will get the same egg story as the Zope 3.4 that ships > with it does, though noone has talked about eggifying Zope 2 yet. We > should probably do that. Indeed. Zope's eggification story needs to be straightened out. We see some of this with Jim's proposals for Zope 3. I'm inclined to watch the discussion for Zope 3 and hopefully see a good solution unfold (of course I won't be afraid to share my opinion). My suspicion is that Zope 2's eggification story will be very similar (best case scenario: identical) to Zope 3's eggification story. So this is one place where I say let Zope 3 work it out first :) > Comments welcome :) Well... constructive comments at least... :) Regards, Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061029/27a32edf/attachment.pgp From lists at zopyx.com Mon Oct 30 15:34:47 2006 From: lists at zopyx.com (Andreas Jung) Date: Mon, 30 Oct 2006 06:34:47 -0800 Subject: [z3-five] RFC: The future of Products.Five In-Reply-To: References: Message-ID: <91114450E4D3E17BA81B990F@suxmac.local> --On 30. Oktober 2006 00:01:33 +0100 Philipp von Weitershausen wrote: > > * It is unclear to me at this point what Zope 2's egg story will be. I > *hope* that 2.11 will get the same egg story as the Zope 3.4 that ships > with it does, though noone has talked about eggifying Zope 2 yet. We > should probably do that. > > What are our benefits from a Z2 Eggification. Eggification is basically about packaging and distribution of components with little dependencies in order to re-use them in other contexts. However most components of Zope 2 are heavily dependent on others. Or are we talking about using Zope 3 eggs within Zope 2 as part of the Zope 2 distribution process? Andreas -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20061030/c294171f/attachment.pgp From regebro at gmail.com Mon Oct 30 16:33:48 2006 From: regebro at gmail.com (Lennart Regebro) Date: Mon, 30 Oct 2006 16:33:48 +0100 Subject: [z3-five] RFC: The future of Products.Five In-Reply-To: References: Message-ID: <319e029f0610300733h71480ccbq9ddf8cf3588b986b@mail.gmail.com> I don't mind making Products.Five smaller. And I don't mind making loads of small packages called five.something either. That said, I think it's important to make as much of zope3 work under zope2, so any zope3 package included in the zope2 distribution should also have it's corresponding five package included, if it exists. That means, that unless you are planning to not include most of Zope3 in Zope2.12, most five packages should be included as well. And if you don't include most of Zope3, then I think most people using Five will be very confused. So I suspect that the hope of not having to maintain stuff is somewhat overly hopeful. ;) From d.w.morriss at gmail.com Mon Oct 30 19:55:15 2006 From: d.w.morriss at gmail.com (whit) Date: Mon, 30 Oct 2006 12:55:15 -0600 Subject: [z3-five] RFC: The future of Products.Five(green eggs and zope) In-Reply-To: References: Message-ID: <45464A93.4000209@gmail.com> Philipp von Weitershausen wrote: > I don't think all of these things should go into the Products.Five > anymore, for several reasons: > > * We're trying to get away from writing products and into writing Python > packages that can e.g. be installed as eggs. > > * Some of these things are not essential to bringing Zope 3 technology > into Zope 2 (e.g. like the intid stuff), so it may be questionable > whether it should ship with Zope 2/Five out of the box. > > * Starting with Zope 2.10, Products.Five is actually getting smaller > which is a trend I would like to continue to see. And if I manage to > land my Acquisition refactoring in 2.11, Products.Five will pretty soon > decrease in size tremendously, and there are also other things in > Products.Five that should really be in Zope 2 proper (e.g. OFS). +1 to this logic > Proposal > -------- > > So, what I'm proposing is to feature-freeze the Products.Five package > and just basically keep making it work for future Zope versions. Five > 1.6 (current trunk) will work for Zope 2.11 (current trunk), Five 1.7 > for 2.12, etc. So, essentially there won't be Five feature releases in > between anymore, which means we can put Products.Five into the > Zope/lib/python/Products proper. > > New stuff will be added in standard Python packages that may or may not > ship with Zope 2, Plone or whoever needs them. I personally almost don't > care, it's really only about defining the right egg dependencies in > Plone 3.0 or Zope 2.11, I would assume (see also 'Risks' below). This > seems like the release manager's job who would include stuff based on > requests from the community and package maintainer's recommendations. > > The namespace for these packages should probably be 'five', as we > already have five.intid and five.customerize and we are, after all, the > Five project. +1 > > Advantages > ---------- > > * We'll be able to use stuff we get for Python packages for free, such > as installation via eggs, Cheeseshop presence and much less majyck for > initialization. > > * Stuff that we create as part of the Five project does not necessarily > have to end up in Zope 2. Currently, stuff added to Products.Five > eventually always ends up in some Zope 2 release which means we'll have > to maintain it forever, no matter how crappy it turns out to be (e.g. > Products.Five.site). flipped around, it would be nice to see the crufty features in Five moved out to their own packages, to enable BBB *if needed*. this is similar to nuxeo's XYZonFive product pattern, but easy_install-able. > * Development of certain components can move much faster than even Five. > New things like five.intid or five.customerize can be experimented with > and already be in the right place if they turn out to be stable. If not, > they won't harm Products.Five, either. Individual packages rather than > one big one also reduces the amount of work that has to be done by the > Five release manager (IOW my work ;)). would like to note that other packages in Zope2 also need this ability to release asynchronously from Zope2's schedule; ZopeTestCase in particular comes to mind(Testing should be a namespace package imho). > > Risks > ----- > > * If five.* packages need ZCML config (and I know some will), they will > either have to be included the Zope 3 way (site.zcml or package-includes > slug in your instance's 'etc' directory), or we need to come up with an > approach that Zope 2 people are more comfortable with. I think an egg > entry point would be a compelling solution. big +1 here. would love to use paste deploy to configure my zope instance. There are plans to do this > in Zope 3 even so that you can provide configuration from Python instead > of ZCML. I expect this to land in Zope 3.4 which means we should be able > to take advantage of it in 2.11. I will defer to other's here but say this: I'd rather have better tools to configure with than more options in the configuration language. > * It is unclear to me at this point what Zope 2's egg story will be. I > *hope* that 2.11 will get the same egg story as the Zope 3.4 that ships > with it does, though noone has talked about eggifying Zope 2 yet. We > should probably do that. re zope2 egg story: some talk has occurred thanks to goldegg and general irritation suffered by myself, rocky, nouri and others. Tres and McDonc have definitely plumbed the ugly depths of zope2 thinking about this problem for goldegg. Nouri has run the plone stack as an egg; I've run Zope2 as an egg. re my experience, I made a somewhat indecipherable post about my experiences with easy_install-ing zope from svn with workingenv. To reiterate, the results are pretty cool: all of zope is installed into your workingenv/lib/python, all your scripts(repozo, mkinstance, etc) are installed into your workingenv/bin . Some minor edits are required to make the scripts find the proper libs(due to SOFTWARE_HOME path expectations) and the site skeleton disappear but really, it's darn close to working as an egg. workingenv takes care of the nasty "where should my zope stuff go in relation to the real python world" question. it's likely that you could use setup_tools prefixing to run multiple different versions of zope in the same env; or just simply make a 2.10 env for your 2.10 instance. this means that the "egg story" really doesn't have to happen inside zope(except for wort removal on the Zope2 package). It can just use a well thought out existing python egg story: workingenv(see http://bfhammer.blogspot.com/2006/09/bootstrapenvironment.html for more info). Perhaps if we want to spruce it up a bit, zopectl could handle workingenv's "source bin/activate" and maybe alias the command "install" to the workingenv's easy_install from the zopectl prompt. The distribution could just be a small setup script for zopectl w/ a workingenv recipe that sets up the equivalent of the software home. We still have to handle the Products issue for add ons(mcdonc, donde estamos con Basketos?). But if Basket is added to 2.11, this might not be such a big deal. this probably more of a separate proposal on "what should the Zope2 egg story be?" so if you have feeling, reply as such. -w From d.w.morriss at gmail.com Mon Oct 30 20:57:40 2006 From: d.w.morriss at gmail.com (whit) Date: Mon, 30 Oct 2006 13:57:40 -0600 Subject: [z3-five] RFC: The future of Products.Five In-Reply-To: <1162184897.6372.10.camel__13445.8040971824$1162185023$gmane$org@localhost> References: <1162184897.6372.10.camel__13445.8040971824$1162185023$gmane$org@localhost> Message-ID: > Indeed. Zope's eggification story needs to be straightened out. We see > some of this with Jim's proposals for Zope 3. I'm inclined to watch the > discussion for Zope 3 and hopefully see a good solution unfold (of > course I won't be afraid to share my opinion). My suspicion is that > Zope 2's eggification story will be very similar (best case scenario: > identical) to Zope 3's eggification story. So this is one place where I > say let Zope 3 work it out first :) > i disagree. I feel like we've waited too long as is. he who waits gets no seat at the table and little choice of what to eat. so far what I've seen of the evolving zope3 egg story does not inspire to think that we should wait for the wisdom of zope3 to trickle down. I always trust Jim to get it right eventually, but I think he might benefit from our ideas and we are the ones working on Zope2 whereas his world is not so much about Zope2. Zope2 is not zope3 and our packaging problems are much different due to legacy and existing use cases. I also think we are not that far away from having a decent solution and that hanging out in limbo land will hurt way more than solving the problem now and adjusting for what z3 does later. trickle-uply yours -w From philipp at weitershausen.de Tue Oct 31 02:56:39 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Tue, 31 Oct 2006 02:56:39 +0100 Subject: [z3-five] RFC: The future of Products.Five In-Reply-To: <91114450E4D3E17BA81B990F@suxmac.local> References: <91114450E4D3E17BA81B990F@suxmac.local> Message-ID: <4546AD57.10705@weitershausen.de> Andreas Jung wrote: > What are our benefits from a Z2 Eggification. Eggification is basically > about packaging and distribution of components with little dependencies > in order to re-use them in other contexts. However most components of > Zope 2 are heavily dependent on others. Yes, that's true. But eggs don't necessarily have to have few dependencies ;). Eggs just have well-defined dependencies. And like Whit said, there might be a desire to have certain Zope 2 components have a faster life cycle than others, e.g. ZopeTestCase in Whit's case. > Or are we talking about using Zope 3 > eggs within Zope 2 as part of the Zope 2 distribution process? That too. As Zope 3.4 will hopefully be embracing eggs for its packaging story, it would be a shame if we wouldn't get that story somehow in Zope 2.11 at the same time. From philipp at weitershausen.de Tue Oct 31 03:06:12 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Tue, 31 Oct 2006 03:06:12 +0100 Subject: [z3-five] RFC: The future of Products.Five In-Reply-To: <319e029f0610300733h71480ccbq9ddf8cf3588b986b@mail.gmail.com> References: <319e029f0610300733h71480ccbq9ddf8cf3588b986b@mail.gmail.com> Message-ID: <4546AF94.8010703@weitershausen.de> Lennart Regebro wrote: > I don't mind making Products.Five smaller. And I don't mind making > loads of small packages called five.something either. > > That said, I think it's important to make as much of zope3 work under > zope2, so any zope3 package included in the zope2 distribution should > also have it's corresponding five package included, if it exists. ... or if it's even necessary. I think we should also still pursue the effort of making Zope 3 integration into Zope 2 more seamless, making five.something hopefully unnecessary most of the time. > That means, that unless you are planning to not include most of Zope3 > in Zope2.12, most five packages should be included as well. Yes, probably. > And if you don't include most of Zope3, then I think most people > using Five will be very confused. So I suspect that the hope of not > having to maintain stuff is somewhat overly hopeful. ;) Well, I won't have to maintain their code at least. If Whit creates five.intid, he's the maintainer of that package. I might still decide to make it part of Zope 2 at some point, but I won't have to maintain it. From regebro at gmail.com Tue Oct 31 07:37:11 2006 From: regebro at gmail.com (Lennart Regebro) Date: Tue, 31 Oct 2006 07:37:11 +0100 Subject: [z3-five] RFC: The future of Products.Five In-Reply-To: <4546AF94.8010703@weitershausen.de> References: <319e029f0610300733h71480ccbq9ddf8cf3588b986b@mail.gmail.com> <4546AF94.8010703@weitershausen.de> Message-ID: <319e029f0610302237v3e213743gb51f2013f5ef3962@mail.gmail.com> On 10/31/06, Philipp von Weitershausen wrote: > Lennart Regebro wrote: > > I don't mind making Products.Five smaller. And I don't mind making > > loads of small packages called five.something either. > > > > That said, I think it's important to make as much of zope3 work under > > zope2, so any zope3 package included in the zope2 distribution should > > also have it's corresponding five package included, if it exists. > > ... or if it's even necessary. I think we should also still pursue the > effort of making Zope 3 integration into Zope 2 more seamless, making > five.something hopefully unnecessary most of the time. Absolutely. > Well, I won't have to maintain their code at least. If Whit creates > five.intid, he's the maintainer of that package. I might still decide to > make it part of Zope 2 at some point, but I won't have to maintain it. OK. :-) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From daniel at infrae.com Tue Oct 31 10:03:55 2006 From: daniel at infrae.com (Daniel Nouri) Date: Tue, 31 Oct 2006 10:03:55 +0100 Subject: [z3-five] RFC: The future of Products.Five(green eggs and zope) In-Reply-To: <45464A93.4000209@gmail.com> References: <45464A93.4000209@gmail.com> Message-ID: <4547117B.6090804@infrae.com> whit wrote: > We still have to handle the Products issue for add ons(mcdonc, donde > estamos con Basketos?). But if Basket is added to 2.11, this might not > be such a big deal. >From what I know, Basket has been abandoned and there's even no good reason for using it. Inside a workingenv you can just go and install egged Products without problems. Daniel From lists at zopyx.com Tue Oct 31 14:51:03 2006 From: lists at zopyx.com (Andreas Jung) Date: Tue, 31 Oct 2006 05:51:03 -0800 Subject: [z3-five] RFC: The future of Products.Five In-Reply-To: <4546AD57.10705@weitershausen.de> References: <91114450E4D3E17BA81B990F@suxmac.local> <4546AD57.10705@weitershausen.de> Message-ID: --On 31. Oktober 2006 02:56:39 +0100 Philipp von Weitershausen wrote: > Andreas Jung wrote: >> What are our benefits from a Z2 Eggification. Eggification is basically >> about packaging and distribution of components with little dependencies >> in order to re-use them in other contexts. However most components of >> Zope 2 are heavily dependent on others. > > Yes, that's true. But eggs don't necessarily have to have few > dependencies ;). Eggs just have well-defined dependencies. And like Whit > said, there might be a desire to have certain Zope 2 components have a > faster life cycle than others, e.g. ZopeTestCase in Whit's case. > Yeah, it would make sense for particular components but not for all components just for the sake of eggs. -aj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://codespeak.net/pipermail/z3-five/attachments/20061031/0582e1a1/attachment.pgp From tseaver at palladion.com Tue Oct 31 16:16:46 2006 From: tseaver at palladion.com (Tres Seaver) Date: Tue, 31 Oct 2006 10:16:46 -0500 Subject: [z3-five] RFC: The future of Products.Five(green eggs and zope) In-Reply-To: <4547117B.6090804@infrae.com> References: <45464A93.4000209@gmail.com> <4547117B.6090804@infrae.com> Message-ID: <454768DE.4050908@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Daniel Nouri wrote: > whit wrote: > >> We still have to handle the Products issue for add ons(mcdonc, donde >> estamos con Basketos?). But if Basket is added to 2.11, this might not >> be such a big deal. > >>From what I know, Basket has been abandoned and there's even no good > reason for using it. Inside a workingenv you can just go and install > egged Products without problems. Basket gives Zope the framework to tickle the 'initialize' entry point in eggs, which is *not* unnecessary AFAIK. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFR2je+gerLs4ltQ4RAom6AKCxfG7AYb9AomqIC8cSbpR5AxkRqQCfVGsC JifP4MVb5PWfZ3IZV5T8x8Y= =Qiwe -----END PGP SIGNATURE----- From chrism at plope.com Tue Oct 31 16:24:24 2006 From: chrism at plope.com (Chris McDonough) Date: Tue, 31 Oct 2006 10:24:24 -0500 Subject: [z3-five] RFC: The future of Products.Five(green eggs and zope) In-Reply-To: <454768DE.4050908@palladion.com> References: <45464A93.4000209@gmail.com> <4547117B.6090804@infrae.com> <454768DE.4050908@palladion.com> Message-ID: <3A2F18D0-3AE4-468A-8BB0-81DB39CAE03B@plope.com> I'd treat Basket as a roadmap of what needs to change in 2.11 for egg product initialization to work. I wouldn't necessarily use any of its code. - C On Oct 31, 2006, at 10:16 AM, Tres Seaver wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Daniel Nouri wrote: >> whit wrote: >> >>> We still have to handle the Products issue for add ons(mcdonc, donde >>> estamos con Basketos?). But if Basket is added to 2.11, this >>> might not >>> be such a big deal. >> >>> From what I know, Basket has been abandoned and there's even no good >> reason for using it. Inside a workingenv you can just go and install >> egged Products without problems. > > Basket gives Zope the framework to tickle the 'initialize' entry point > in eggs, which is *not* unnecessary AFAIK. > > > Tres. > - -- > =================================================================== > Tres Seaver +1 202-558-7113 tseaver at palladion.com > Palladion Software "Excellence by Design" http://palladion.com > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFFR2je+gerLs4ltQ4RAom6AKCxfG7AYb9AomqIC8cSbpR5AxkRqQCfVGsC > JifP4MVb5PWfZ3IZV5T8x8Y= > =Qiwe > -----END PGP SIGNATURE----- > > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > From daniel at infrae.com Tue Oct 31 17:30:29 2006 From: daniel at infrae.com (Daniel Nouri) Date: Tue, 31 Oct 2006 17:30:29 +0100 Subject: [z3-five] RFC: The future of Products.Five(green eggs and zope) In-Reply-To: <454768DE.4050908@palladion.com> References: <45464A93.4000209@gmail.com> <4547117B.6090804@infrae.com> <454768DE.4050908@palladion.com> Message-ID: <45477A25.9070307@infrae.com> Tres Seaver wrote: > Daniel Nouri wrote: >>> whit wrote: >>> >>>> We still have to handle the Products issue for add ons(mcdonc, donde >>>> estamos con Basketos?). But if Basket is added to 2.11, this might not >>>> be such a big deal. >>> >From what I know, Basket has been abandoned and there's even no good >>> reason for using it. Inside a workingenv you can just go and install >>> egged Products without problems. > > Basket gives Zope the framework to tickle the 'initialize' entry point > in eggs, which is *not* unnecessary AFAIK. 'intialize' will be called for eggs that use the Products namespace package. If the Product lives outside of Products, it must use the 'five:registerPackage' directive so that its 'initialize' is called. One thing to note is that if you install such an egg that has a Products namespace system-wide, it will be 'initialize'd in every Zope instance. So it's advisable to 1) not use the Products namespace package and rely on 'five:registerPackage' if you need 'initialize' and 2) use workingenv or zc.buildout to install the eggs. Daniel From chrism at plope.com Tue Oct 31 17:51:08 2006 From: chrism at plope.com (Chris McDonough) Date: Tue, 31 Oct 2006 11:51:08 -0500 Subject: [z3-five] RFC: The future of Products.Five(green eggs and zope) In-Reply-To: <45477A25.9070307@infrae.com> References: <45464A93.4000209@gmail.com> <4547117B.6090804@infrae.com> <454768DE.4050908@palladion.com> <45477A25.9070307@infrae.com> Message-ID: <47A10534-1510-4F26-9B10-3FDFCFCD6FE9@plope.com> On Oct 31, 2006, at 11:30 AM, Daniel Nouri wrote: > Tres Seaver wrote: >> Daniel Nouri wrote: >>>> whit wrote: >>>> >>>>> We still have to handle the Products issue for add ons(mcdonc, >>>>> donde >>>>> estamos con Basketos?). But if Basket is added to 2.11, this >>>>> might not >>>>> be such a big deal. >>>>> From what I know, Basket has been abandoned and there's even no >>>>> good >>>> reason for using it. Inside a workingenv you can just go and >>>> install >>>> egged Products without problems. >> >> Basket gives Zope the framework to tickle the 'initialize' entry >> point >> in eggs, which is *not* unnecessary AFAIK. > > 'intialize' will be called for eggs that use the Products namespace > package. If the Product lives outside of Products, it must use the > 'five:registerPackage' directive so that its 'initialize' is called. I know nothing of five:registerPackage, but Basket's model doesn't care whether or not a package is in the Products namespace. It has two modes: DWIM mode, which calls "initialize" for all packages in eggs which have a "zope2.initialize" entry point, and a non-DWIM mode under which you must spell out the packages that should be initialized in a separate INI file (this is akin to using ZCML to spell out each of them). Note that in the model that basket uses, an egg might contain more than one Product as well. The egg contains a 'zope2.initialize' entry point for each product which the egg contains. I've pasted the Basket readme to the end of this email, which explains all of this. > > One thing to note is that if you install such an egg that has a > Products > namespace system-wide, it will be 'initialize'd in every Zope > instance. > So it's advisable to 1) not use the Products namespace package and > rely > on 'five:registerPackage' if you need 'initialize' and 2) use > workingenv > or zc.buildout to install the eggs. I think the reason that Phillip put entry points in the egg spec is just for this sort of thing. I'm not sure if they're being used now for Zope 2 eggs (or if there even is such a thing), but imo they probably should be. - C Basket Overview Basket is a Zope 2 product which allows you to employ the Python Egg format to deploy other Zope 2 products. Where Do Eggs Go? You can put Product eggs anywhere on your Zope 2 instance's PYTHONPATH. A "safe" place to put them is '$INSTANCE_HOME/lib/python' which is on the PYTHONPATH of every post-2.6 Zope 2 installation. Definitions Product -- A Python package that (optionally) includes an initialization function which gets called at Zope startup time. Products may be packaged as eggs using Basket; otherwise they are typically packaged as tarballs which are meant to be unpacked in a Zope 2 "Products" directory. Egg Product -- a Product packaged up as part of a Product Distribution. Product Distribution -- A Python "egg" which contains one or more Zope 2 Products. How Does Basket Determine Which Products To Install? Default: Implicit By default, Basket will scan your PYTHONPATH for files or directories ending with the extension ".egg". These are known as "distributions". For each of these distributions Basket finds, it will introspect the content of the file or directory. If the file is a zip file and its egg metadata contains one or more "zope2.initialize" "entry points", this distribution will be considered to be a Product distribution and its constituent Products will be considered for initialization. The same action will happen if the .egg is a directory. If two versions of the same distribution are found on the PYTHONPATH, Basket will prevent startup from occurring by raising a pkg_resources.VersionConflictError. If Basket detects a situation in which two distinct Product distributions contain a Product that has the same name (a case which is not caught by pkg_resources), Basket will prevent startup by raising an exception. Optional: Explicit If you create a file in your INSTANCE_HOME/etc directory named PRODUCT_DISTRIBUTIONS.txt, Basket will not scan the PYTHONPATH for Product distributions. Instead, Basket will attempt to load Product distributions based only on the explicit Python Egg-format Product distribution names on each line within the PRODUCT_DISTRIBUTIONS.txt file. The eggs representing these distributions must be somewhere on the PYTHONPATH. If a line in the file names a distribution that cannot be in the PYTHONPATH, Basket will prevent startup from occurring by raising a pkg_resources.DistribtionNotFound error. If the PRODUCT_DISTRIBUTIONS.txt contains directives that cause two or more versions of the same distribution to be considered, a pkg_resources.VersionConflictError will be raised. If Basket detects a situation in which two distinct Product distributions contain a Product that has the same name (a case which is not caught by pkg_resources), Basket will prevent startup by raising an exception if Zope is in debug mode. How Do I Create Eggs that are Compatible with Basket? The only hard-and-fast requirement for creating a Product distribution is that you must create a "built egg":http://peak.telecommunity.com/DevCenter/PkgResources. A Product distribution is are simply a set of Python packages which includes one or more initialization functions which Zope will call during its startup process. For your egg to be recognized as a Zope Product, you will need to define one or more "entry points" of type 'zope2.initialize' in your setup.py 'setup' call indicating which functions should be called during initialization. If your product distribution contains only one Product, this "entry point" is conventionally just 'SomePackageName:initialize'. If the object that the entry point definition points to is a callable, it will be called with a "ProductContext" instance during Zope startup. However, the object that the entry point definition "points" to needn't be a callable. If it is not a callable, Basket will not attempt to call it. For Zope products that don't implement an "initialize" function, something like "SomePackageName:__name__" is a good "dummy" entry point definition. Products that are packaged as 'zip-safe' egg files must not attempt to use Zope API functions that expect Product files to exist within a filesystem structure. If your Zope product does this (either directly or indirectly by use of a library which attempts to access Product files), you must ensure that you package your Product as "non-zip-safe". This means that you must add a 'zip_safe = False' argument to your setup.py's setup call. By doing this, your product will still be packaged as a zipfile and can be distributed as one, but Basket will know that it needs to uncompress the zipfile to a temporary directory at startup to make use of it. CMF/Plone products which use CMF versions up to 1.6 (and perhaps beyond) need to be packaged as non-zip-safe because they use libraries that access the filesystem (such as filesystem directory views). A Product distribution may include a "Products" namespace package, but it is not required. Each package within a Product distribution which directly contains a 'zope2.initialize' function will be considered a separate "Product". This means that the name of a non-module package which directly contains the 'zope2.initialize' function will be used as a Product name in Zope's control panel and for legacy Zope API methods which expect to be able to use a Product name to access constructor functions. Note that the behavior of Products packaged within Product distributions differs slightly from that of "legacy" Products inasmuch as "egg Products" will not be imported at Zope startup time and will not show up in the ControlPanel list unless their packaging specifies a 'zope2.initialize' entry point. Hello World (with Products Namespace Package) filesystem layout:: | |-- setup.py | |-- Products -- | |-- __init__.py | |-- product1 -- | |-- __init__.py setup.py:: from setuptools import setup, find_packages import ez_setup ez_setup.use_setuptools() setup( name = 'product1', version = '0.1', packages = find_packages(), namespace_packages=['Products'], entry_points = {'zope2.initialize': ['initialize=Products.product1:initialize']}, url = 'http://www.example.com/product1', author = 'Joe Bloggs', author_email = 'bloggs at example.com', ) Products/__init__.py:: # this is a namespace package Products/product1/__init__.py:: # this is a product initializer def initialize(self): return "product1 initialized" Hello World (no namespace packages) filesystem layout:: | |-- setup.py | |-- product1 -- | |-- __init__.py setup.py:: from setuptools import setup, find_packages import ez_setup ez_setup.use_setuptools() setup( name = 'product1', version = '0.1', packages = find_packages(), entry_points = {'zope2.initialize': ['initialize=product1:initialize']}, url = 'http://www.example.com/product1', author = 'Joe Bloggs', author_email = 'bloggs at example.com', ) product1/__init__.py:: # this is a product initializer def initialize(self): return "product1 initialized" Multiple Products In A Single Distribution filesystem layout:: | |-- setup.py | |-- product1 -- | | | |-- __init__.py | |-- product2 -- | |-- __init__.py setup.py:: from setuptools import setup, find_packages import ez_setup ez_setup.use_setuptools() setup( name = 'products1and2', version = '0.1', packages = find_packages(), entry_points = {'zope2.initialize': ['initialize1=product1:initialize', 'initialize2=product2:initialize']}, url = 'http://www.example.com/products1and2', author = 'Joe Bloggs', author_email = 'bloggs at example.com', ) product1/__init__.py:: # this is a product initializer def initialize(self): return "product1 initialized" product2/__init__.py:: # this is a product initializer def initialize(self): return "product2 initialized" Non-Zip-Safe Product filesystem layout:: | |-- setup.py | |-- product -- | |-- __init__.py setup.py:: from setuptools import setup, find_packages import ez_setup ez_setup.use_setuptools() setup( name = 'product', version = '0.1', packages = find_packages(), entry_points = {'zope2.initialize': ['initialize=product:initialize']}, url = 'http://www.example.com/product1', author = 'Joe Bloggs', author_email = 'bloggs at example.com', zip_safe = False, ) product/__init__.py:: # this is a product initializer def initialize(self): return "non-zip-safe product initialized" Building a Product Distribution 'python setup.py bdist_egg' The ".egg" file created in dist is the Product distribution. Refer to the "setuptools documentation":http://peak.telecommunity.com/DevCenter/setuptools for advanced options. Replacements for File-Bound Classes The following Zope classes may not be sucessfully used within a Product packaged as a 'zip-safe' egg:: Globals.DTMLFile Globals.ImageFile Products.PageTemplates.PageTemplateFile.PageTemplateFile Instead, use these replacement classes (which have compatible constructors and are monkey-patched into place by Basket):: Globals.DTMLResource Globals.ImageResource Products.PageTemplates.PageTemplateResource CMF's "Filesystem Directory View" and its supporting classes like "FSFile", "FSPageTemplate", et. al may also not be used in Products packaged as zipfiles. Work to make the CMF filesystem skin machinery understand zipfiles is underway in a SVN branch at the time of this writing but is not yet released. Custom code within your product that expects to be able to use package resources as files on a filesystem (e.g. by using "os.listdir", "open", "os.stat", etc.) against files in the product package will fail. Replace this code with the equivalent calls from the "pkg_resources" module (which may be imported via "import pkg_resources" when Basket is installed). See the "pkg_resources documentation":http://peak.telecommunity.com/DevCenter/setuptools for more information. Broken Objects If objects in your root folder show up as "Broken" that are instances of classes which are defined in an egg, put the following statement in your instance's etc/zope.conf file:: %import Products.Basket This causes the Basket product to "pre-initialize" much earlier than it would have otherwise done so, hopefully preventing the machinery which marks things as broken from doing so for egg-based objects. Forward Compatibility Notices Basket ships with a Python 2.3-compatible version of setuptools' pkg_resources module. At Basket initialization time, this module is inserted into sys.modules as "pkg_resources" (possibly shadowing another pkg_resources module you've imported). This is necessary unless we want to require people to install setuptools before using Basket. Note that the use of PRODUCT_DISTRIBUTIONS.txt may vanish in a later release of Basket in favor of a special section within the Zope 2 main configuration file. The implicit load-all-product-distributions behavior may become non-default in a later release in favor of using explicit distribution naming. The "Basket" product is a stopgap solution to the problem of being able to package Zope products as Python eggs. Its functionality will be folded into a later Zope release, at which point it will cease to be useful and disappear (although eggs created which make use of its facilities will continue to work). Therefore, you should not depend on importing or otherwise using the "Products.Basket" package or its contents anywhere in your own Zope code. From daniel at infrae.com Tue Oct 31 18:35:44 2006 From: daniel at infrae.com (Daniel Nouri) Date: Tue, 31 Oct 2006 18:35:44 +0100 Subject: [z3-five] RFC: The future of Products.Five(green eggs and zope) In-Reply-To: <47A10534-1510-4F26-9B10-3FDFCFCD6FE9@plope.com> References: <45464A93.4000209@gmail.com> <4547117B.6090804@infrae.com> <454768DE.4050908@palladion.com> <45477A25.9070307@infrae.com> <47A10534-1510-4F26-9B10-3FDFCFCD6FE9@plope.com> Message-ID: <45478970.6070205@infrae.com> Chris McDonough wrote: > > On Oct 31, 2006, at 11:30 AM, Daniel Nouri wrote: > >> Tres Seaver wrote: >>> Daniel Nouri wrote: >>>>> whit wrote: >>>>> >>>>>> We still have to handle the Products issue for add ons(mcdonc, donde >>>>>> estamos con Basketos?). But if Basket is added to 2.11, this might >>>>>> not >>>>>> be such a big deal. >>>>>> From what I know, Basket has been abandoned and there's even no good >>>>> reason for using it. Inside a workingenv you can just go and install >>>>> egged Products without problems. >>> >>> Basket gives Zope the framework to tickle the 'initialize' entry point >>> in eggs, which is *not* unnecessary AFAIK. >> >> 'intialize' will be called for eggs that use the Products namespace >> package. If the Product lives outside of Products, it must use the >> 'five:registerPackage' directive so that its 'initialize' is called. > > I know nothing of five:registerPackage, but Basket's model doesn't care > whether or not a package is in the Products namespace. It has two > modes: DWIM mode, which calls "initialize" for all packages in eggs > which have a "zope2.initialize" entry point, and a non-DWIM mode under > which you must spell out the packages that should be initialized in a > separate INI file (this is akin to using ZCML to spell out each of > them). Note that in the model that basket uses, an egg might contain > more than one Product as well. The egg contains a 'zope2.initialize' > entry point for each product which the egg contains. I've pasted the > Basket readme to the end of this email, which explains all of this. I've tried out Basket and failed. I think it doesn't work for Zope 2.9 and newer. However, having installed other Python packages through easy_install before, I also found it a bit unintuitive to use (in theory). I think Basket is overdoing it. Zope 2 doesn't need such a specialized egg story. If we can install eggs the normal way (easy_install) and they work and we can use known techniques (zcml slugs) to include them in an instance, at least *I* am happy. Entry points are definitely great and I do hope that they'll replace zcml slugs soon. That'll have to work for Zope 2 packages too (so five:registerPackage becomes unnecessary) and I think there we can learn from Basket. >> >> One thing to note is that if you install such an egg that has a Products >> namespace system-wide, it will be 'initialize'd in every Zope instance. >> So it's advisable to 1) not use the Products namespace package and rely >> on 'five:registerPackage' if you need 'initialize' and 2) use workingenv >> or zc.buildout to install the eggs. > > I think the reason that Phillip put entry points in the egg spec is just > for this sort of thing. I'm not sure if they're being used now for Zope > 2 eggs (or if there even is such a thing), but imo they probably should be. AFAIK, for both Zope 2 and Zope 3 you have to put a zcml slug into package-includes. (For Zope 2 only if you live outside Products though.) Check out Whit's blog entry [1] if you haven't done so. He explains how to set up a workingenv inside a Zope 2 instance. I recently played with a script that installs Plone by setting up a Zope instance combined with a workingenv, and pulling all necessary Products and packages in as eggs [2]. [1] http://bfhammer.blogspot.com/2006/09/bootstrapenvironment.html [2] http://lists.plone.org/pipermail/framework-team/2006-October/000784.html From philipp at weitershausen.de Wed Nov 1 13:11:22 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Wed, 01 Nov 2006 13:11:22 +0100 Subject: [z3-five] RFC: The future of Products.Five In-Reply-To: References: <91114450E4D3E17BA81B990F@suxmac.local> <4546AD57.10705@weitershausen.de> Message-ID: <45488EEA.9050203@weitershausen.de> Andreas Jung wrote: >> Andreas Jung wrote: >>> What are our benefits from a Z2 Eggification. Eggification is basically >>> about packaging and distribution of components with little dependencies >>> in order to re-use them in other contexts. However most components of >>> Zope 2 are heavily dependent on others. >> >> Yes, that's true. But eggs don't necessarily have to have few >> dependencies ;). Eggs just have well-defined dependencies. And like Whit >> said, there might be a desire to have certain Zope 2 components have a >> faster life cycle than others, e.g. ZopeTestCase in Whit's case. >> > > Yeah, it would make sense for particular components but not for all > components just for the sake of eggs. Well, it may be that we decide to embrace eggs for our packaging story, at least in Zope 3 (as a replacement for zpkg). At that point we should ask ourselves if it wouldn't be a good idea to do the same for Zope 2. In Zope 2, eggs could really help with the add-on story (as a more general replacement for Products). From philipp at weitershausen.de Sat Nov 4 21:47:08 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Sat, 04 Nov 2006 21:47:08 +0100 Subject: [z3-five] Five release fest: Five 1.3.8, 1.4.2, 1.5.1 released Message-ID: <454CFC4C.4070700@weitershausen.de> The Five team is happy to announce the release of three Five stable releases today! Many thanks to Rocky Burt for making those releases! What is Five ------------ Five is a Zope 2 product that allows you to integrate Zope 3 technologies into Zope 2, today. Among others, it allows you to use Zope 3 interfaces, ZCML-based configuration, adapters, browser pages (including skins, layers, and resources), automated add and edit forms based on schemas, object events, as well as Zope 3-style i18n message catalogs. We've tried to keep the Five experience as close to Zope 3 as possible, so this means that what you learn while using Five should also be applicable to Zope 3, and viceversa. More information about Five can be found on our website, http://codespeak.net/z3/five/. Changes ------- * browser: processInputs now decodes strings in lists and tuples. * Made the __call__ method of ViewMixinForAttributes have the same signature as the original attribute. This aids some pathological request parameter marshalling. * Port code from Zope 3 making resource directories recursive. Thanks to Richard Waid. * formlib: Removed redundant subpageform.pt and pageform.pt. Added missing error view configuration. (Five 1.4 and 1.5 only) * Fixed #2168: Missing import (Five 1.5 only) * site: Fixed small bug in FiveSiteManager. (issue #2198) (Five 1.5 only) About the Zope 3 Base --------------------- Five is part of the *Zope 3 Base* project, which aims to offer an approachable area for developers of Zope 3 related software. More about the Zope 3 base and its projects can be found on the project website, http://codespeak.net/z3/. From plone at kevinkal.com Sat Nov 11 17:57:36 2006 From: plone at kevinkal.com (kevin7kal) Date: Sat, 11 Nov 2006 11:57:36 -0500 Subject: [z3-five] BTreeFolder with Five Message-ID: <45560100.3070205@kevinkal.com> I'm trying to make a BTree Folder. I'm assuming my zcml is correct because I end up with a MyBTree item in the zmi drop down list and the add form renders, when I press the add button I recieve 'none type object has no attribute keys'. My class and interface are here followed by the traceback. This is zope 2.9.4 and five 1.4.1. Thanks in advance for any input! -Kevin class MyBTree(BTreeFolder2): '''A Btree folder ''' interface.implements(IMyBTree) title=fieldproperty.FieldProperty(IMyBTree['title']) def __init__(self,tmpID='',tmpTITLE=''): '''pass an empty tmpID and tmpTITLE''' class IMyBTree(interface.Interface): '''interface for MyBTree''' title=schema.TextLine(title=u'Name', required=True) Module Products.PageTemplates.TALES, line 221, in evaluate - URL: index - Line 18, Column 8 - Expression: standard:'view/update' - Names: {'container': <+ at />, 'context': <+ at />, 'default': , 'here': <+ at />, 'loop': , 'modules': , 'nothing': None, 'options': {'args': (,)}, 'repeat': , 'request': , 'root': , 'template': , 'traverse_subpath': [], 'user': , 'view': , 'views': } Module Products.PageTemplates.Expressions, line 185, in __call__ Module Products.PageTemplates.Expressions, line 180, in _eval Module Products.PageTemplates.Expressions, line 85, in render Module Products.Five.form, line 156, in update Module Products.Five.form, line 210, in createAndAdd Module Products.Five.form, line 232, in add Module Products.Five.browser.adding, line 78, in add Module OFS.ObjectManager, line 309, in _setObject Module zope.event, line 23, in notify Module zope.app.event.dispatching, line 66, in dispatch Module zope.component, line 181, in subscribers Module zope.component.site, line 89, in subscribers Module zope.interface.adapter, line 481, in subscribers Module zope.app.event.objectevent, line 192, in objectEventNotify Module zope.component, line 181, in subscribers Module zope.component.site, line 89, in subscribers Module zope.interface.adapter, line 481, in subscribers Module OFS.subscribers, line 106, in dispatchObjectWillBeMovedEvent Module zope.app.container.contained, line 183, in dispatchToSublocations Module OFS.subscribers, line 88, in sublocations Module Products.BTreeFolder2.BTreeFolder2, line 366, in objectValues Module Products.BTreeFolder2.BTreeFolder2, line 357, in objectIds AttributeError: 'NoneType' object has no attribute 'keys' From k_vertigo at objectrealms.net Sun Nov 12 15:23:36 2006 From: k_vertigo at objectrealms.net (Kapil Thangavelu) Date: Sun, 12 Nov 2006 09:23:36 -0500 Subject: [z3-five] BTreeFolder with Five In-Reply-To: <45560100.3070205@kevinkal.com> References: <45560100.3070205@kevinkal.com> Message-ID: nothing to do with five/zcml.. you should call the base class constructor in your init method, it setups some bookeeping data structures for btrees or call self._initBTrees() in your constructor directly. On Sat, 11 Nov 2006 11:57:36 -0500, kevin7kal wrote: > I'm trying to make a BTree Folder. I'm assuming my zcml is correct > because I end up with a MyBTree item in the zmi drop down list and the > add form renders, when I press the add button I recieve 'none type > object has no attribute keys'. My class and interface are here > followed by the traceback. This is zope 2.9.4 and five 1.4.1. > Thanks in advance for any input! > -Kevin > > class MyBTree(BTreeFolder2): > '''A Btree folder ''' > interface.implements(IMyBTree) > title=fieldproperty.FieldProperty(IMyBTree['title']) > def __init__(self,tmpID='',tmpTITLE=''): > '''pass an empty tmpID and tmpTITLE''' > Module Products.BTreeFolder2.BTreeFolder2, line 366, in objectValues > Module Products.BTreeFolder2.BTreeFolder2, line 357, in objectIds > AttributeError: 'NoneType' object has no attribute 'keys' From plone at kevinkal.com Mon Nov 13 12:54:28 2006 From: plone at kevinkal.com (kevin7kal) Date: Mon, 13 Nov 2006 06:54:28 -0500 Subject: [z3-five] BTreeFolder with Five In-Reply-To: References: <45560100.3070205@kevinkal.com> Message-ID: <45585CF4.5090802@kevinkal.com> Ok, didn't realize that. Thanks! It works perfectly now. Kapil Thangavelu wrote: > nothing to do with five/zcml.. you should call the base class constructor > in your init method, it setups some bookeeping data structures for btrees > or call self._initBTrees() in your constructor directly. > > On Sat, 11 Nov 2006 11:57:36 -0500, kevin7kal wrote: > > >> I'm trying to make a BTree Folder. I'm assuming my zcml is correct >> because I end up with a MyBTree item in the zmi drop down list and the >> add form renders, when I press the add button I recieve 'none type >> object has no attribute keys'. My class and interface are here >> followed by the traceback. This is zope 2.9.4 and five 1.4.1. >> Thanks in advance for any input! >> -Kevin >> >> class MyBTree(BTreeFolder2): >> '''A Btree folder ''' >> interface.implements(IMyBTree) >> title=fieldproperty.FieldProperty(IMyBTree['title']) >> def __init__(self,tmpID='',tmpTITLE=''): >> '''pass an empty tmpID and tmpTITLE''' >> > > >> Module Products.BTreeFolder2.BTreeFolder2, line 366, in objectValues >> Module Products.BTreeFolder2.BTreeFolder2, line 357, in objectIds >> AttributeError: 'NoneType' object has no attribute 'keys' >> > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > > From D.Schulz81 at gmx.net Tue Nov 14 17:49:22 2006 From: D.Schulz81 at gmx.net (Dennis Schulz) Date: Tue, 14 Nov 2006 17:49:22 +0100 Subject: [z3-five] zc.table sorting Message-ID: <20061114164922.153030@gmx.net> Hi, I have tried to sort my columns by the following code that I found in various examples around: columns = [ GetterColumn(name=u'name', title=u'Full Name', getter=lambda i, f: '%s' % (quote(i.name), i.name), subsort=True), GetterColumn(name=u'description', title=u'Full Description', getter=lambda i, f: i.description, subsort=True), GetterColumn(name=u'purchasingclass', title=u'Purchasing Class', getter=lambda i, f: i.purchasingClass.name, subsort=True) ] for c in columns: directlyProvides(c, zc.table.interfaces.ISortableColumn) I get the following error and traceback: ( I use Zope 2.9.5, Plone 2.5.1, Five 1.4.1, zc.table 0.6 py 2.4.egg, are there any proves that zc.table sorting works with this zope version??) Error Type ComponentLookupError Error Message (, , 'zc.table') 2006-11-14 17:38:25 ERROR Zope.SiteErrorLog http://localhost:8080/dennis/applications/purchaserequisition.2006-11-07.5098603683/tableview.html Traceback (innermost last): Module ZPublisher.Publish, line 115, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 41, in call_object Module zope.formlib.form, line 757, in __call__ Module Products.Five.formlib.formbase, line 46, in update Module plone.app.form._patches, line 53, in update Module zope.formlib.form, line 738, in update Module zope.formlib.form, line 582, in success Module Products.PurchaseRequisition.browser.purchaseRequisition, line 90, in handle_search_action Module Shared.DC.Scripts.Bindings, line 311, in __call__ Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 113, in _exec Module Products.PageTemplates.PageTemplate, line 104, in pt_render - Module TAL.TALInterpreter, line 238, in __call__ Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 749, in do_useMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 780, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 728, in do_defineMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 772, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 728, in do_defineMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 647, in do_insertStructure_tal Module Products.PageTemplates.TALES, line 221, in evaluate - URL: pagetable - Line 9, Column 2 - Expression: standard:'view/table' - Names: {'container': , 'context': , 'default': , 'here': , 'loop': , 'modules': , 'nothing': None, 'options': {'args': ()}, 'repeat': , 'request': , 'root': , 'template': , 'traverse_subpath': [], 'user': , 'view': , 'views': } Module Products.PageTemplates.Expressions, line 185, in __call__ Module Products.PageTemplates.Expressions, line 180, in _eval Module Products.PageTemplates.Expressions, line 85, in render Module zc.table.table, line 66, in __call__ Module zc.table.table, line 75, in renderContents Module zc.table.table, line 80, in renderHeaderRow Module zc.table.table, line 84, in renderHeaders Module zc.table.table, line 88, in renderHeader Module zc.table.table, line 349, in getHeader Module zc.table.table, line 354, in _addSortUi Module zope.component, line 141, in getAdapter ComponentLookupError: (, , 'zc.table') -- "Ein Herz f?r Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de Unser Dankesch?n: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht! From philipp at weitershausen.de Tue Nov 14 19:15:24 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Tue, 14 Nov 2006 19:15:24 +0100 Subject: [z3-five] zc.table sorting In-Reply-To: <20061114164922.153030@gmx.net> References: <20061114164922.153030@gmx.net> Message-ID: <455A07BC.5000608@weitershausen.de> Dennis Schulz wrote: > Hi, > I have tried to sort my columns by the following code that I found in various examples around: > > columns = [ > GetterColumn(name=u'name', title=u'Full Name', getter=lambda i, f: '%s' % (quote(i.name), i.name), subsort=True), > GetterColumn(name=u'description', title=u'Full Description', getter=lambda i, f: i.description, subsort=True), > GetterColumn(name=u'purchasingclass', title=u'Purchasing Class', getter=lambda i, f: i.purchasingClass.name, subsort=True) > ] > > for c in columns: > directlyProvides(c, zc.table.interfaces.ISortableColumn) > > > I get the following error and traceback: > ( I use Zope 2.9.5, Plone 2.5.1, Five 1.4.1, zc.table 0.6 py 2.4.egg, > are there any proves that zc.table sorting works with this zope version??) No idea. But from the looks of it it seems that you didn't include zc.table's configuration. You need somewhere in your ZCML tree (site.zcml, package-includes/*-configure.zcml, your Product's configure.zcml, etc.). -- http://worldcookery.com -- Professional Zope documentation and training From d.schulz81 at gmx.net Tue Nov 14 20:55:37 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Tue, 14 Nov 2006 20:55:37 +0100 Subject: [z3-five] zc.table sorting Message-ID: <455A1F39.5070100@gmx.net> Sorry, but the adding of in my configure.zcml didn't change anything. Here the way I call the Formater: self.table = table.FormSortFormatter(self.context, self.request, results, columns=columns, batch_start=0, batch_size=2, sort_on=(('name', True),)) The problem is that the adapter can't be found in the rendering method .... Module zc.table.table, line 354, in _addSortUi Module zope.component, line 141, in getAdapter Can anyone tell me how to interpret this line exactly ComponentLookupError: (, , 'zc.table') the view behind tableview.html can't lookup the component with the name "zc.table" and zope.interface.Interface cant be adapted? how can I solve this? Dennis > Dennis Schulz wrote: > > Hi, > > I have tried to sort my columns by the following code that I found > in various examples around: > > > > columns = [ > > GetterColumn(name=u'name', title=u'Full Name', getter=lambda i, > f: '%s' % > (quote(i.name), i.name), subsort=True), > > GetterColumn(name=u'description', title=u'Full Description', > getter=lambda i, f: i.description, subsort=True), > > GetterColumn(name=u'purchasingclass', title=u'Purchasing Class', > getter=lambda i, f: i.purchasingClass.name, subsort=True) > > ] > > > > for c in columns: > > directlyProvides(c, zc.table.interfaces.ISortableColumn) > > > > > > I get the following error and traceback: > > ( I use Zope 2.9.5, Plone 2.5.1, Five 1.4.1, zc.table 0.6 py 2.4.egg, > > are there any proves that zc.table sorting works with this zope > version??) > > No idea. But from the looks of it it seems that you didn't include > zc.table's configuration. You need > somewhere in your ZCML tree (site.zcml, > package-includes/*-configure.zcml, your Product's configure.zcml, etc.). > > > > -- > http://worldcookery.com > > -- Professional Zope documentation and training > > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > From d.schulz81 at gmx.net Wed Nov 15 11:31:20 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Wed, 15 Nov 2006 11:31:20 +0100 Subject: [z3-five] zc.table sorting / resourceLibrary dependency Message-ID: <455AEC78.7090107@gmx.net> I think I know know what my problem is: I removed the dependency from the zc.table configure.zcml because in an older posting I read that resourceLibrary doesn't work on Zope 2 and one can get rid off the dependency without problems. However, when you use sorting, the ui renderer wants to look up the java script and cant find it. How to solve this? (Changes to the zcml statement or change the zc.table.table code?) Anyone managed a working StandaloneSortFormatter on Zope 2? Dennis -------- Original-Nachricht -------- Datum: Tue, 14 Nov 2006 20:55:37 +0100 Von: Dennis Schulz An: z3-five at codespeak.net Betreff: [z3-five] zc.table sorting > Sorry, but the adding of in my > configure.zcml didn't change anything. > > Here the way I call the Formater: > > self.table = table.StandaloneSortFormatter(self.context, > self.request, > results, > columns=columns, > batch_start=0, > batch_size=2, > sort_on=(('name', > True),)) > > The problem is that the adapter can't be found in the rendering method > .... > > Module zc.table.table, line 354, in _addSortUi > Module zope.component, line 141, in getAdapter > > > Can anyone tell me how to interpret this line exactly > > ComponentLookupError: ( URL=http://localhost:8080/dennis/applications/purchaserequisition.2006-11-07.5098603683/tableview.html>, > , 'zc.table') > > the view behind tableview.html can't lookup the component with the name > "zc.table" and zope.interface.Interface cant be adapted? > > how can I solve this? > > > > Dennis > > > > > > > Dennis Schulz wrote: > > > Hi, > > > I have tried to sort my columns by the following code that I found > > in various examples around: > > > > > > columns = [ > > > GetterColumn(name=u'name', title=u'Full Name', getter=lambda i, > > f: '%s' % > > (quote(i.name), i.name), subsort=True), > > > GetterColumn(name=u'description', title=u'Full Description', > > getter=lambda i, f: i.description, subsort=True), > > > GetterColumn(name=u'purchasingclass', title=u'Purchasing Class', > > getter=lambda i, f: i.purchasingClass.name, subsort=True) > > > ] > > > > > > for c in columns: > > > directlyProvides(c, zc.table.interfaces.ISortableColumn) > > > > > > > > > I get the following error and traceback: > > > ( I use Zope 2.9.5, Plone 2.5.1, Five 1.4.1, zc.table 0.6 py 2.4.egg, > > > are there any proves that zc.table sorting works with this zope > > version??) > > > > No idea. But from the looks of it it seems that you didn't include > > zc.table's configuration. You need > > somewhere in your ZCML tree (site.zcml, > > package-includes/*-configure.zcml, your Product's configure.zcml, etc.). > > > > > > > > -- > > http://worldcookery.com > > > > > -- Professional Zope documentation and training > > > > _______________________________________________ > > z3-five mailing list > > z3-five at codespeak.net > > http://codespeak.net/mailman/listinfo/z3-five > > > > > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five From chris at simplistix.co.uk Wed Nov 15 12:59:56 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Wed, 15 Nov 2006 11:59:56 +0000 Subject: [z3-five] Adaptation in untrusted code Message-ID: <455B013C.20601@simplistix.co.uk> Hi All, I need to do the following in a python script or a page template: IRender(obj).render(context) So, I've sacrificed the following chickens: - allow_module(MyProduct.interfaces) (which is where IRender comes from, so I can import it) - security.declarePublic('render') for the render method of my adapter. The latter makes me uneasy. It's needed because the adapter is created without any acquisition context and so Zope 2's security machinery thinks the current user is defined outside of the context of the object being accessed. What I really want is to do: security.declarePublic(View,'render') ...in my adapter code. How can I go about doing this? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From maciej.wisniowski at coig.katowice.pl Wed Nov 15 14:11:04 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Wed, 15 Nov 2006 14:11:04 +0100 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: <455B013C.20601@simplistix.co.uk> References: <455B013C.20601@simplistix.co.uk> Message-ID: <455B11E8.9060205@coig.katowice.pl> > I need to do the following in a python script or a page template: > > IRender(obj).render(context) > > So, I've sacrificed the following chickens: > > - allow_module(MyProduct.interfaces) > (which is where IRender comes from, so I can import it) > > - security.declarePublic('render') for the render method of my adapter. > > The latter makes me uneasy. It's needed because the adapter is created > without any acquisition context and so Zope 2's security machinery > thinks the current user is defined outside of the context of the object > being accessed. > I had exactly same problem yesterday (adapter to Cacheable objects that flushes individual cache entries) and unfortunatelly I finished with workaround - using external method. How do you set security in your ZCML file?? > What I really want is to do: > > security.declarePublic(View,'render') > > ...in my adapter code. How can I go about doing this? You mean: security.declareProtected('View','render')? It didn't worked for me but I've been lost in security declarations from zcml and security in old Zope2 way... and I was not sure what, where and how... BTW. Chris, I've removed this silly thing from my Thunderbird config ;) -- Maciej Wisniowski From D.Schulz81 at gmx.net Wed Nov 15 15:23:10 2006 From: D.Schulz81 at gmx.net (Dennis Schulz) Date: Wed, 15 Nov 2006 15:23:10 +0100 Subject: [z3-five] zc.resourcelibrary in zope 2 Message-ID: <20061115142310.101270@gmx.net> Hi, I was wondering what is the preferred way to replace the zc.resourcelibrary call in zc.table when you want your resources outsourced the same way in a Python/lib/site-packeage dirctory (for example the zc.table.resource folder)? Is there a way to register the dir as skin directory etc? Dennis -- "Ein Herz f?r Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de Unser Dankesch?n: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht! From optilude at gmx.net Thu Nov 16 01:17:20 2006 From: optilude at gmx.net (Martin Aspeli) Date: Thu, 16 Nov 2006 00:17:20 +0000 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: <455B013C.20601@simplistix.co.uk> References: <455B013C.20601@simplistix.co.uk> Message-ID: Chris Withers wrote: > Hi All, > > I need to do the following in a python script or a page template: > > IRender(obj).render(context) I think you need a view. :) Seriously, views make your life so much easier when it comes to doing anything not completely trivial with rendering/display logic. For me, at least, they've also made me more productive - there's some more set-up to do to begin with, but it's way easier to write code when you're not trying to squeeze everything into python: expressions - and compared to adding a Script (Python) they're no more code at all (think of it as moving the crap out of the ## comments in the headers and into ZCML). > What I really want is to do: > > security.declarePublic(View,'render') > > ...in my adapter code. How can I go about doing this? You can do allowed_attributes="render" and permission="zope2.View" on the statement, I believe. You're sure it's the render() bit that's failing and not the IRender(obj) lookup that needs context it doesn't have though? Honestly, I've never tried, it just seemed really wrong to put Zope 3 stuff into Script (Python)'s. :) Martin From chris at simplistix.co.uk Thu Nov 16 10:00:57 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 16 Nov 2006 09:00:57 +0000 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: <455B11E8.9060205@coig.katowice.pl> References: <455B013C.20601@simplistix.co.uk> <455B11E8.9060205@coig.katowice.pl> Message-ID: <455C28C9.6060404@simplistix.co.uk> Maciej Wisniowski wrote: > workaround - using external method. How do you set security in your ZCML > file?? Eh? You don't? >> What I really want is to do: >> >> security.declarePublic(View,'render') >> >> ...in my adapter code. How can I go about doing this? > You mean: > security.declareProtected('View','render')? Sorry, yes... > It didn't worked for me It won't, and I know why it won't (I thought I explained that in my last mail...) but that doesn't mean I know how to solve the problem ;-) > BTW. Chris, I've removed this silly thing from my Thunderbird config ;) Glad to see it :-) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Thu Nov 16 10:22:52 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 16 Nov 2006 09:22:52 +0000 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: References: <455B013C.20601@simplistix.co.uk> Message-ID: <455C2DEC.9080901@simplistix.co.uk> Martin Aspeli wrote: > Chris Withers wrote: >> Hi All, >> >> I need to do the following in a python script or a page template: >> >> IRender(obj).render(context) > > I think you need a view. :) Indeed. Can you give me a simple example of how you'd do this as a view? Philipp said that views adapt the request, whereas no request is involved here and nor do I want it do be... >> ...in my adapter code. How can I go about doing this? > > You can do allowed_attributes="render" and permission="zope2.View" on > the statement, I believe. Nope, adapter has no "allowed_attributes" attribute. > You're sure it's the render() bit that's failing Yes. > Honestly, > I've never tried, it just seemed really wrong to put Zope 3 stuff into > Script (Python)'s. :) Why? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Thu Nov 16 12:10:32 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 16 Nov 2006 11:10:32 +0000 Subject: [z3-five] Adapter and View insanity Message-ID: <455C4728.3000000@simplistix.co.uk> Hi All, I need to render representations of objects and sometimes override their titles, so I came up with an interface: class IRender(Interface): def render(context,title=None) "" The context parameter is because the rendering can change depending on where its being used. So, this works really well from code and I end up with nice little snippets like: self._html = IRender(obj).render(context,title) Okay, so now I want to re-use this to render objects inside a ZPT. My first attempt at this was horrific:

Having cleaned up the resulting vomit, I decided to try and use a view, as suggested by Martin A. The only way I could seem to do that was to have a whole seperate class: class Render: def __call__(self): return IRender(self.context).render(self.context) ...which I then have to write zcml to register: Which means I can finally do this:

But there's still a few problems: 1. I'm instantiating yet another class every time I just want to adapt something and call a method 2. I can't pass in a title or explicit context. I have to work the context out using acquisition :-( 3. I'm deeply disturbed as to how instances of my Render view class come to magically have a context attribute. wtf? So, anyway I'm left wondering: - what's the _minimum_ I need to do to be able to use something like:

...to mean "adapt item to IRender and call its render method"? - how do I do the equivalent of item/@@render in python? (I'm hoping this will enlighten me as to how I'd pass an explicit context and title in) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Thu Nov 16 12:39:09 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 16 Nov 2006 11:39:09 +0000 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: <5af21ed10611160328k39f586b1uada616fc19004e26@mail.gmail.com> References: <455B013C.20601@simplistix.co.uk> <455C2DEC.9080901@simplistix.co.uk> <5af21ed10611160328k39f586b1uada616fc19004e26@mail.gmail.com> Message-ID: <455C4DDD.8010409@simplistix.co.uk> Martin Aspeli wrote: >> Indeed. Can you give me a simple example of how you'd do this as a view? >> Philipp said that views adapt the request, whereas no request is >> involved here and nor do I want it do be... > > Where are you doing this? Why does it matter? What do you mean by "where"? I'm doing it wherever I want a rendering of an object relative to another object and maybe with a title override. This is primarily for creating internal linking around a site but I want to re-use it for things like listing on a contents view, etc. > In general, if you register a view, you give it a name and you say > what interface it can be available on (or * for any type): > > name="foo" > for=".interfaces.IMyType" > template="some-template.pt" I don't need a template here, I already have an set of adapters for my objects which do what I want. I just want to be able to use them sanely from inside ZPT's, see my other post. > So, you traverse to /mytype/@@foo (the @@ is optional, but disambiguates). I'd prefer these to be traversable inside a ZPT but not in a URL, but I'd put up with them being url traversable if I really must. > If your class derives from Products.Five.browser.BrowserView (I assume > you're on Zope 2 underneath, if not it's > zope.publisher.browser.BrowserView I think), you can override > __call__() to do whatever (using self.context and self.request as > appropriate). Dammit, why can't I just use a simple adapter :-( Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From optilude at gmx.net Thu Nov 16 12:48:11 2006 From: optilude at gmx.net (Martin Aspeli) Date: Thu, 16 Nov 2006 11:48:11 +0000 (UTC) Subject: [z3-five] Adaptation in untrusted code References: <455B013C.20601@simplistix.co.uk> <455C2DEC.9080901@simplistix.co.uk> <5af21ed10611160328k39f586b1uada616fc19004e26@mail.gmail.com> <455C4DDD.8010409@simplistix.co.uk> Message-ID: Chris Withers simplistix.co.uk> writes: > > Martin Aspeli wrote: > >> Indeed. Can you give me a simple example of how you'd do this as a view? > >> Philipp said that views adapt the request, whereas no request is > >> involved here and nor do I want it do be... > > > > Where are you doing this? > > Why does it matter? What do you mean by "where"? I'm doing it wherever I > want a rendering of an object relative to another object and maybe with > a title override. This is primarily for creating internal linking around > a site but I want to re-use it for things like listing on a contents > view, etc. > > > In general, if you register a view, you give it a name and you say > > what interface it can be available on (or * for any type): > > > > > Why browser:page? I _only_ want to be able to do: browser:view, then > tal:content="structure obj/ render" > > ...and I think I can get away with not having an explicit context. I > certainly don't need the title override. Every adapter has a context. A view also knows something about its request, which you can use or not use. This all comes from the fact that you are traversing to the view (foo/@@view) rather than looknig it up in code explicitly. > > name="foo" > > for=".interfaces.IMyType" > > template="some-template.pt" > > I don't need a template here, I already have an set of adapters for my > objects which do what I want. I just want to be able to use them sanely > from inside ZPT's, see my other post. Skip the template but then. The point is that if you have a page template anyway, you could make the template be bound to a view, so that you could put all the rendering logic specific tot his template in the view class and access it in TAL via the implicit 'view' variable. > > So, you traverse to /mytype/ foo (the is optional, but disambiguates). > > I'd prefer these to be traversable inside a ZPT but not in a URL, but > I'd put up with them being url traversable if I really must. If you use a view class for the template then you can restrict however you wish. Traversal in ZPT and in URLs are very tightly bound to one another, so I'm not sure how you could allow one but not the other. But if you had a view class that was preparing data, then it could use a regular adapter and not a view. > > If your class derives from Products.Five.browser.BrowserView (I assume > > you're on Zope 2 underneath, if not it's > > zope.publisher.browser.BrowserView I think), you can override > > __call__() to do whatever (using self.context and self.request as > > appropriate). > > Dammit, why can't I just use a simple adapter You can. You just can't traverse to an adapter using foo/@@adapter_name as you seem to want to do. You can either do it in a view class and return the rendered result for use in TAL, or you can have a view on foo that does whatever. See also my other reply to your post on z3-user. Martin From optilude at gmx.net Thu Nov 16 12:56:03 2006 From: optilude at gmx.net (Martin Aspeli) Date: Thu, 16 Nov 2006 11:56:03 +0000 (UTC) Subject: [z3-five] Adapter and View insanity References: <455C4728.3000000@simplistix.co.uk> Message-ID: Chris Withers simplistix.co.uk> writes: > I need to render representations of objects and sometimes override their > titles, so I came up with an interface: > > class IRender(Interface): > > def render(context,title=None) > "" When you are passing context in like this, you may want to think about having multi-adapters that adapt the object being rendered and the context it's rendered in. It may not always be appropriate, of course, but it allows you to vary the adapter registration by either or both (so override based on object type and/or context type). If you find that you have multiple functions all taking that 'context' parameter, it may be a sign that you're really after a multi-adapter. > The context parameter is because the rendering can change depending on > where its being used. > > So, this works really well from code and I end up with nice little > snippets like: > > self._html = IRender(obj).render(context,title) > > Okay, so now I want to re-use this to render objects inside a ZPT. > > My first attempt at this was horrific: > >

If the template was really a view, registered with , you'd have a class in which you cuold put this logic: class MyView(BrowserView): def render(self, item, title): return IRender(item).render(self.context, title) And then in the template: tal:replace="python:view.render(item, title)" Sometimes it may be more appropriate to step back another step and construct lists of dicts or whatever that have done all the necessary processing and are used with simple (non-python:) expressions in TAL. Sometimes that may be overkill. > Having cleaned up the resulting vomit, I decided to try and use a view, > as suggested by Martin A. The only way I could seem to do that was to > have a whole seperate class: > > class Render: > > def __call__(self): > return IRender(self.context).render(self.context) > > ...which I then have to write zcml to register: > > for="*" > name="render" > class=".views.Render" > permission="zope2.View"/> > > Which means I can finally do this: > >

> > But there's still a few problems: > > 1. I'm instantiating yet another class every time I just want to adapt > something and call a method So you could instantiate once in a tal:define and put the logic in a method rather than in __call__(). > 2. I can't pass in a title or explicit context. I have to work the > context out using acquisition Again solved by a method. > 3. I'm deeply disturbed as to how instances of my Render view class come > to magically have a context attribute. wtf? It's a browser view. The ZCML directive injects a base class. Yes, it's nasty, which is why it's normally saner to explicitly inherit from Products.Five.browser.BrowserView. > So, anyway I'm left wondering: > > - what's the _minimum_ I need to do to be able to use something like: > >

> > ...to mean "adapt item to IRender and call its render method"? See above. > - how do I do the equivalent of item/ render in python? (I'm hoping > this will enlighten me as to how I'd pass an explicit context and title in) You can use restrictedTraverse() if you wish, but really you are doing: from zope.component import getMultiAdapter render = getMultiAdapter((context, view), name='render') print render() Martin From chris at simplistix.co.uk Thu Nov 16 12:57:02 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 16 Nov 2006 11:57:02 +0000 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: References: <455B013C.20601@simplistix.co.uk> <455C2DEC.9080901@simplistix.co.uk> <5af21ed10611160328k39f586b1uada616fc19004e26@mail.gmail.com> <455C4DDD.8010409@simplistix.co.uk> Message-ID: <455C520E.5020609@simplistix.co.uk> Martin Aspeli wrote: >>> If your class derives from Products.Five.browser.BrowserView (I assume >>> you're on Zope 2 underneath, if not it's >>> zope.publisher.browser.BrowserView I think), you can override >>> __call__() to do whatever (using self.context and self.request as >>> appropriate). >> Dammit, why can't I just use a simple adapter > > You can. You just can't traverse to an adapter using foo/@@adapter_name as you > seem to want to do. You can either do it in a view class and return the > rendered result for use in TAL, or you can have a view on foo that does > whatever. Can you explain the difference between "do it in a view class and return the rendered result" and "have a view on foo that does whatever"? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From rocky at serverzen.com Thu Nov 16 13:20:46 2006 From: rocky at serverzen.com (Rocky Burt) Date: Thu, 16 Nov 2006 08:50:46 -0330 Subject: [z3-five] Adapter and View insanity In-Reply-To: References: <455C4728.3000000@simplistix.co.uk> Message-ID: <1163679646.11048.1.camel@localhost> On Thu, 2006-16-11 at 11:56 +0000, Martin Aspeli wrote: > > 3. I'm deeply disturbed as to how instances of my Render view class come > > to magically have a context attribute. wtf? > > It's a browser view. The ZCML directive injects a base class. Yes, it's nasty, > which is why it's normally saner to explicitly inherit from > Products.Five.browser.BrowserView. Personally I just provide my own __init__ which assigns context and request. But Martin is right, when using Five will actually create it's own view class. This magic that I know Philip tried to get away from with a proposal but I don't believe anything came of the proposal. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061116/3a923a30/attachment.pgp From optilude at gmx.net Thu Nov 16 13:30:35 2006 From: optilude at gmx.net (Martin Aspeli) Date: Thu, 16 Nov 2006 12:30:35 +0000 (UTC) Subject: [z3-five] Adaptation in untrusted code References: <455B013C.20601@simplistix.co.uk> <455C2DEC.9080901@simplistix.co.uk> <5af21ed10611160328k39f586b1uada616fc19004e26@mail.gmail.com> <455C4DDD.8010409@simplistix.co.uk> <455C520E.5020609@simplistix.co.uk> Message-ID: Chris Withers simplistix.co.uk> writes: > > Martin Aspeli wrote: > >>> If your class derives from Products.Five.browser.BrowserView (I assume > >>> you're on Zope 2 underneath, if not it's > >>> zope.publisher.browser.BrowserView I think), you can override > >>> __call__() to do whatever (using self.context and self.request as > >>> appropriate). > >> Dammit, why can't I just use a simple adapter > > > > You can. You just can't traverse to an adapter using foo/ adapter_name as you > > seem to want to do. You can either do it in a view class and return the > > rendered result for use in TAL, or you can have a view on foo that does > > whatever. > > Can you explain the difference between "do it in a view class and return > the rendered result" and "have a view on foo that does whatever"? I think what you want is this: - a browser:page that is *the template you are working with*. This has a template attribute to specify the page template and a class attribute that specifies a view class - this view class inherits (explicitly or implicitly) BrowserView, which just means that it's an appropriate multi-adapter (it can get context and request in its __init__() method). - whatever logic you need in the template goes in methods on this view class, and you use them in tal:content/replace/repeat expressions that are as simple as possible - you do your IRender() plain adapter lookups etc inside such methods and return the rendered results for display in the template You could register views for everything that is to be rendered (the second option above), but as you identify you'd need to look it up each time (that's the point). Martin From optilude at gmx.net Thu Nov 16 13:37:37 2006 From: optilude at gmx.net (Martin Aspeli) Date: Thu, 16 Nov 2006 12:37:37 +0000 (UTC) Subject: [z3-five] Adapter and View insanity References: <455C4728.3000000@simplistix.co.uk> <1163679646.11048.1.camel@localhost> Message-ID: Rocky Burt serverzen.com> writes: > > On Thu, 2006-16-11 at 11:56 +0000, Martin Aspeli wrote: > > > 3. I'm deeply disturbed as to how instances of my Render view class come > > > to magically have a context attribute. wtf? > > > > It's a browser view. The ZCML directive injects a base class. Yes, it's nasty, > > which is why it's normally saner to explicitly inherit from > > Products.Five.browser.BrowserView. > > Personally I just provide my own __init__ which assigns context and > request. But Martin is right, when using Five will > actually create it's own view class. This magic that I know Philip > tried to get away from with a proposal but I don't believe anything came > of the proposal. Indeed. Also, Five's version of BrowserView mixes in acquisition, which is needed to avoid security problems in zope 2. Martin From maciej.wisniowski at coig.katowice.pl Thu Nov 16 15:21:23 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Thu, 16 Nov 2006 15:21:23 +0100 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: References: <455B013C.20601@simplistix.co.uk> Message-ID: <455C73E3.5000805@coig.katowice.pl> >> I need to do the following in a python script or a page template: >> >> IRender(obj).render(context) > > I think you need a view. :) > > Seriously, views make your life so much easier when it comes to doing > anything not completely trivial with rendering/display logic. For me, at > least, they've also made me more productive And what if there is nothing to do with rendering/display? I have written simple adapter for RAMCacheManager that allows me to flush individual cache entries. It would be nice if I'll be able to call from one Script (Python) something like: from Products.RAMCacheManagerPlus.interfaces import ICacheablePlus ICacheablePlus(context.secScript).invalidate( keywords_req={'AUTHENTICATED_USER':request.AUTHENTICATED_USER} partial = 1) where ICacheablePlus is my adapter and context.secScript is Script(Python) with caching enabled. It works from external methods and Products, but not from the 'content space'. I tried some things but seems it can't be done. You may take a look here: (http://code.google.com/p/ramcachemanagerplus/) and: http://ramcachemanagerplus.googlecode.com/svn/trunk/configure.zcml -- Maciej Wisniowski From chris at simplistix.co.uk Thu Nov 16 15:57:43 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 16 Nov 2006 14:57:43 +0000 Subject: [z3-five] views, paths and urls Message-ID: <455C7C67.4080908@simplistix.co.uk> Hi All, Okay, so I have view registered: And I can do the following just fine:

However, if I go to the following url: https://localhost:8080/somobj/@@render ...I get a 404. What sheep have I forgotten to sacrifice? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From maciej.wisniowski at coig.katowice.pl Thu Nov 16 16:19:11 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Thu, 16 Nov 2006 16:19:11 +0100 Subject: [z3-five] views, paths and urls In-Reply-To: <455C7C67.4080908@simplistix.co.uk> References: <455C7C67.4080908@simplistix.co.uk> Message-ID: <455C816F.5080903@coig.katowice.pl> > However, if I go to the following url: > > https://localhost:8080/somobj/@@render > > ...I get a 404. > > What sheep have I forgotten to sacrifice? Maybe something with References: <455C7C67.4080908@simplistix.co.uk> <455C816F.5080903@coig.katowice.pl> Message-ID: <455C81D9.1000901@simplistix.co.uk> Maciej Wisniowski wrote: >> >> What sheep have I forgotten to sacrifice? > Maybe something with References: <455C7C67.4080908@simplistix.co.uk> Message-ID: <455C8502.9080702@simplistix.co.uk> Chris Withers wrote: > However, if I go to the following url: > > https://localhost:8080/somobj/@@render > > ...I get a 404. And when I finally found the reason, many an expletive was muttered under my breath, several expressing murderous intentions towards Zope 2's publisher and all its kin... Zope 2's BaseRequest insists that published objects have a doc string and silently fails with a NotFound if they don't :-( Goat sacrificed, gods appeased, view rendered... Sometimes Zope makes me want to die... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From maciej.wisniowski at coig.katowice.pl Thu Nov 16 17:38:11 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Thu, 16 Nov 2006 17:38:11 +0100 Subject: [z3-five] views, paths and urls In-Reply-To: <455C8502.9080702@simplistix.co.uk> References: <455C7C67.4080908@simplistix.co.uk> <455C8502.9080702@simplistix.co.uk> Message-ID: <455C93F3.2090403@coig.katowice.pl> > Zope 2's BaseRequest insists that published objects have a doc string > and silently fails with a NotFound if they don't :-( So where did you finally add this docstring? To a .views.Render.render method? AFAIR messages about lack of docstring are displayed (at last sometimes). I even tried simple example from Five/docs/products/democontent. DemoContent class has no docstrings, and when trying to access http://localhost:8080/democontentobj/mymethod (democontentobj is obviously instance of democontent) I get: Site Error An error was encountered while publishing this resource. Debugging Notice Zope has encountered a problem publishing your object. The object at http://localhost:8080/democontentobj/mymethod has an empty or missing docstring. Objects must have a docstring to be published. -- Maciej Wisniowski From d.schulz81 at gmx.net Thu Nov 16 18:18:36 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Thu, 16 Nov 2006 18:18:36 +0100 Subject: [z3-five] future z3 development for plone / resourcelibrary alternatives Message-ID: <455C9D6C.3020102@gmx.net> Hi everybody, I started to build a webapplication with Plone 2.5.1, Zope 2.9.5, Five 1.4.2 using zope 3 elements such as formlib and zc.table. One of the big problems I stumbled into is that a lot of zope 3 components and widgets such as datetimewidget depend on zc.resourcelibrary which can't be used in the newest available plone version 2.5.1, so the generated forms by formlib are very basic, usually mainly text fields.......... I found a component called "cpsresourcelibrary" which is said to run under zope 2 but I couldn't get it to run in accordance with the widgets until now. Any suggestions for a replacement of zc.resourcelibrary in 2.5 Plone development? I read on the Plone.org that Plone 3 will be released in March and will include Zope 3.3 completly. So I was thinking of developing the application in zope 3 completly. But this would only make sense if it is more or less sure, that the application will run on Plone 3 without any bigger problems. The probably easier way to get it on Plone right now would be to forget about formlib generation, make the forms myself still using the zope 3 views, adapters and permissions etc........ Dennis From k.suess at gmx.net Thu Nov 16 21:07:45 2006 From: k.suess at gmx.net (=?ISO-8859-1?Q?Katja_S=FCss?=) Date: Thu, 16 Nov 2006 21:07:45 +0100 Subject: [z3-five] view Message-ID: <455CC511.10809@gmx.net> Hi * I want to customize the news and event portlets. Not the layout but the displayed items set. To do this I define a view for context/@@events_view: class EventsPortlet(utils.BrowserView): implements(IEventsPortlet) And add in configure.zcml But I receive a ConfigurationConflictError. Do I have to rewrite the portlet page template like context/@@my_events_view and define a view with this name my_events_view? Or can I avoid to copy the page template and rewrite the line with @@events_view? Thanks for any hint, Katja From k_vertigo at objectrealms.net Thu Nov 16 23:46:29 2006 From: k_vertigo at objectrealms.net (Kapil Thangavelu) Date: Thu, 16 Nov 2006 17:46:29 -0500 Subject: [z3-five] future z3 development for plone / resourcelibrary alternatives In-Reply-To: <455C9D6C.3020102@gmx.net> References: <455C9D6C.3020102@gmx.net> Message-ID: On Thu, 16 Nov 2006 12:18:36 -0500, Dennis Schulz wrote: > Hi everybody, > > I started to build a webapplication with Plone 2.5.1, Zope 2.9.5, Five > 1.4.2 using zope 3 elements such as formlib and zc.table. > > One of the big problems I stumbled into is that a lot of zope 3 > components and widgets such as datetimewidget depend on > zc.resourcelibrary which can't be used in the newest available plone > version 2.5.1, so the generated forms by formlib are very basic, usually > mainly text fields.......... > I found a component called "cpsresourcelibrary" which is said to run > under zope 2 but I couldn't get it to run in accordance with the widgets > until now. > > Any suggestions for a replacement of zc.resourcelibrary in 2.5 Plone > development? > > I read on the Plone.org that Plone 3 will be released in March and will > include Zope 3.3 completly. > So I was thinking of developing the application in zope 3 completly. But > this would only make sense if it is more or less sure, that the > application will run on Plone 3 without any bigger problems. > > The probably easier way to get it on Plone right now would be to forget > about formlib generation, make the forms myself still using the zope 3 > views, adapters and permissions etc........ > you could just define a custom z3 datetime widget, utilizing the extant z3 one as a reference and utilize more in line javascript, or load up the file explictly. afaik there isn't a replacement for the zc.resourcelibrary, though you might want to bring that up on the five dev list as a feature for the future. -kapil From tseaver at palladion.com Fri Nov 17 03:38:12 2006 From: tseaver at palladion.com (Tres Seaver) Date: Thu, 16 Nov 2006 21:38:12 -0500 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: <455C73E3.5000805@coig.katowice.pl> References: <455B013C.20601@simplistix.co.uk> <455C73E3.5000805@coig.katowice.pl> Message-ID: <455D2094.1020303@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maciej Wisniowski wrote: > I have written simple adapter for RAMCacheManager that allows me > to flush individual cache entries. It would be nice if I'll be able > to call from one Script (Python) something like: > > from Products.RAMCacheManagerPlus.interfaces import ICacheablePlus > ICacheablePlus(context.secScript).invalidate( > keywords_req={'AUTHENTICATED_USER':request.AUTHENTICATED_USER} > partial = 1) > > > where ICacheablePlus is my adapter and > context.secScript is Script(Python) with caching enabled. > > It works from external methods and Products, but not from the > 'content space'. What error results from trying that inside a Python Script? Even better, write up a unit test which: - Registers an adapter using the syntax you expect (might be a "dummy" version) - Creates and invokes a Python Script with an instance for which the adapter lookup should succeed. - Asserts that the result of calling your method on the adapter is what you expect. Write it as either a "classic" unit test or as a doctest narrative, and then we can all run it and see what happens. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFXSCU+gerLs4ltQ4RAjMAAKC3Cb5WxsNOpmEVwqRrkg1/dLqsOACePJZ2 iQxtv1oSqAGgjbZpA8VwvP4= =ZtVf -----END PGP SIGNATURE----- From tseaver at palladion.com Fri Nov 17 03:40:07 2006 From: tseaver at palladion.com (Tres Seaver) Date: Thu, 16 Nov 2006 21:40:07 -0500 Subject: [z3-five] views, paths and urls In-Reply-To: <455C93F3.2090403@coig.katowice.pl> References: <455C7C67.4080908@simplistix.co.uk> <455C8502.9080702@simplistix.co.uk> <455C93F3.2090403@coig.katowice.pl> Message-ID: <455D2107.7050506@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maciej Wisniowski wrote: >> Zope 2's BaseRequest insists that published objects have a doc string >> and silently fails with a NotFound if they don't :-( > So where did you finally add this docstring? To a > .views.Render.render method? > > > AFAIR messages about lack of docstring are displayed (at last > sometimes). I even tried simple example from > Five/docs/products/democontent. > > DemoContent class has no docstrings, and when trying to access > http://localhost:8080/democontentobj/mymethod > (democontentobj is obviously instance of democontent) I get: > > Site Error > An error was encountered while publishing this resource. > Debugging Notice > Zope has encountered a problem publishing your object. > The object at http://localhost:8080/democontentobj/mymethod has an empty > or missing docstring. Objects must have a docstring to be published. Yup. If Chris had done his testing on a debug-mode instance, he would've seen the "no docstring" error messages on the console. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFXSEH+gerLs4ltQ4RAuF8AJ4mKHy9e/LC9arcZWtqbcRfcu7ghACgt/Ki U7pdF+3NNYGWY80+4cQ5rTw= =Oa6j -----END PGP SIGNATURE----- From chris at simplistix.co.uk Fri Nov 17 09:42:10 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 17 Nov 2006 08:42:10 +0000 Subject: [z3-five] views, paths and urls In-Reply-To: <455C93F3.2090403@coig.katowice.pl> References: <455C7C67.4080908@simplistix.co.uk> <455C8502.9080702@simplistix.co.uk> <455C93F3.2090403@coig.katowice.pl> Message-ID: <455D75E2.3070007@simplistix.co.uk> Maciej Wisniowski wrote: >> Zope 2's BaseRequest insists that published objects have a doc string >> and silently fails with a NotFound if they don't :-( > So where did you finally add this docstring? To a > .views.Render.render method? No, to the .views.Render class itself. > AFAIR messages about lack of docstring are displayed (at last > sometimes). I even tried simple example from > Five/docs/products/democontent. Only if you run in debug mode, which I don't, 'cos I don't trust it to not do something critically different from production mode. cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Fri Nov 17 09:09:08 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 17 Nov 2006 08:09:08 +0000 Subject: [z3-five] view In-Reply-To: <455CC511.10809@gmx.net> References: <455CC511.10809@gmx.net> Message-ID: <455D6E24.8010006@simplistix.co.uk> Katja S?ss wrote: > But I receive a ConfigurationConflictError. Maybe you could enlighten us by actually supplying the full traceback and exception information? ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Fri Nov 17 09:36:02 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 17 Nov 2006 08:36:02 +0000 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: <455C73E3.5000805@coig.katowice.pl> References: <455B013C.20601@simplistix.co.uk> <455C73E3.5000805@coig.katowice.pl> Message-ID: <455D7472.4070507@simplistix.co.uk> Maciej Wisniowski wrote: > from Products.RAMCacheManagerPlus.interfaces import ICacheablePlus > ICacheablePlus(context.secScript).invalidate( > keywords_req={'AUTHENTICATED_USER':request.AUTHENTICATED_USER} > partial = 1) > > where ICacheablePlus is my adapter and > context.secScript is Script(Python) with caching enabled. I got this working without a problem, it's just that it looks butt ugly in a page template ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Fri Nov 17 09:40:34 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 17 Nov 2006 08:40:34 +0000 Subject: [z3-five] Adapter and View insanity In-Reply-To: References: <455C4728.3000000@simplistix.co.uk> Message-ID: <455D7582.5070607@simplistix.co.uk> Martin Aspeli wrote: > When you are passing context in like this, you may want to think about having > multi-adapters that adapt the object being rendered and the context it's > rendered in. Nah, in this case, context could have easilly been "target" with the adapted object being "source". I need the specific instance, so I see where you're coming from, but no, it's not what I should do here... >>

> > If the template was really a view, registered with , you'd have > a class in which you cuold put this logic: > > class MyView(BrowserView): > > def render(self, item, title): > return IRender(item).render(self.context, title) > > And then in the template: > > tal:replace="python:view.render(item, title)" Ah yes, that is nice, but some of the places where it's used are not conducive to being turned into views ;-) So, I think I'll stick with @@render for now, no matter how much I bitch about it ;-) >> But there's still a few problems: >> >> 1. I'm instantiating yet another class every time I just want to adapt >> something and call a method > > So you could instantiate once in a tal:define and put the logic in a method > rather than in __call__(). Yuk. >> 2. I can't pass in a title or explicit context. I have to work the >> context out using acquisition > > Again solved by a method. True enough, hopefully I won't need this... >> 3. I'm deeply disturbed as to how instances of my Render view class come >> to magically have a context attribute. wtf? > > It's a browser view. The ZCML directive injects a base class. Yes, it's nasty, > which is why it's normally saner to explicitly inherit from > Products.Five.browser.BrowserView. See, I don't really understand what inheriting from BrowserView buys you... Why is the magic there?! > You can use restrictedTraverse() if you wish, but really you are doing: > > from zope.component import getMultiAdapter > render = getMultiAdapter((context, view), name='render') > print render() What's 'view' in the above? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From k.suess at gmx.net Fri Nov 17 10:12:11 2006 From: k.suess at gmx.net (=?ISO-8859-1?Q?Katja_S=FCss?=) Date: Fri, 17 Nov 2006 10:12:11 +0100 Subject: [z3-five] view In-Reply-To: <455D6E24.8010006@simplistix.co.uk> References: <455CC511.10809@gmx.net> <455D6E24.8010006@simplistix.co.uk> Message-ID: <455D7CEB.1000001@gmx.net> Chris Withers schrieb: > Katja S?ss wrote: >> But I receive a ConfigurationConflictError. > > Maybe you could enlighten us by actually supplying the full traceback > and exception information? ;-) > > cheers, > > Chris > seems that a view can not be redefined File "/Users/katjasuess/sweetzope/instances/plone_2.5/Products/Five/__init__.py", line 29, in initialize zcml.load_site() File "/Users/katjasuess/sweetzope/instances/plone_2.5/Products/Five/zcml.py", line 41, in load_site _context = xmlconfig.file(file) File "/usr/local/bin/zope_2.9.4/lib/python/zope/configuration/xmlconfig.py", line 556, in file context.execute_actions() File "/usr/local/bin/zope_2.9.4/lib/python/zope/configuration/config.py", line 606, in execute_actions for action in resolveConflicts(self.actions): File "/usr/local/bin/zope_2.9.4/lib/python/zope/configuration/config.py", line 1511, in resolveConflicts raise ConfigurationConflictError(conflicts) zope.configuration.config.ConfigurationConflictError: Conflicting configuration actions For: ('view', None, u'events_view', , ) File "/Users/katjasuess/sweetzope/instances/plone_2.5/Products/CMFPlone/browser/configure.zcml", line 81.2-87.8 File "/Users/katjasuess/sweetzope/instances/plone_2.5/Products/sweetSite/browser/configure.zcml", line 24.2-30.8 For: ('view', None, u'news_view', , ) File "/Users/katjasuess/sweetzope/instances/plone_2.5/Products/CMFPlone/browser/configure.zcml", line 73.2-79.8 File "/Users/katjasuess/sweetzope/instances/plone_2.5/Products/sweetSite/browser/configure.zcml", line 16.2-22.8 From chris at simplistix.co.uk Fri Nov 17 10:32:46 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 17 Nov 2006 09:32:46 +0000 Subject: [z3-five] view In-Reply-To: <455D7CEB.1000001@gmx.net> References: <455CC511.10809@gmx.net> <455D6E24.8010006@simplistix.co.uk> <455D7CEB.1000001@gmx.net> Message-ID: <455D81BE.3000605@simplistix.co.uk> Katja S?ss wrote: > Chris Withers schrieb: >> Katja S?ss wrote: >>> But I receive a ConfigurationConflictError. >> Maybe you could enlighten us by actually supplying the full traceback >> and exception information? ;-) >> >> cheers, >> >> Chris >> > > seems that a view can not be redefined I think you need to put your view override in overrides.zcml, not configure.zcml... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From maciej.wisniowski at coig.katowice.pl Fri Nov 17 16:33:12 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Fri, 17 Nov 2006 16:33:12 +0100 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: <455D2094.1020303@palladion.com> References: <455B013C.20601@simplistix.co.uk> <455C73E3.5000805@coig.katowice.pl> <455D2094.1020303@palladion.com> Message-ID: <455DD638.8080707@coig.katowice.pl> > better, write up a unit test which: I've written some tests. They're expected to be put into Five/tests. I've checked them on Zope 2.8.8 and with Five 1.2.6. Few issues: Do I need References: <455B013C.20601@simplistix.co.uk> <455C73E3.5000805@coig.katowice.pl> <455D2094.1020303@palladion.com> <455DD638.8080707@coig.katowice.pl> Message-ID: <455E0942.9010605@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maciej Wisniowski wrote: >> better, write up a unit test which: > > I've written some tests. They're expected to be put into Five/tests. > I've checked them on Zope 2.8.8 and with Five 1.2.6. Are they failing as checked in? > Few issues: > Do I need Why is user supposed to be a Manager? > > > Tests exhibits following behaviours: > 1. Adapter called directly from test works > 2. Adapter called by Script Python: > 1. When there is no ' Unauthorized: The container has no security assertions. Access to > 'testmethod' of (Products.Five.tests.contentspaceadapters. > CacheablePlus instance at 0x2aaab3dd3b90) denied. > > 2. When there is ' Unauthorized: The owner of the executing script does not have the > required permission. Access to 'testmethod' of > (Products.Five.tests.contentspaceadapters.CacheablePlus instance at > 0x2aaab3e03560) denied. Access requires one of the following > roles: ['Manager']. The executing script is (PythonScript at > /test_folder_1_/tester), owned by test_user_1_, who has the roles > ['Authenticated', 'test_role_1_']. Looks like nobody has given the appropriate permission to 'test_role_1_' on that object. > 3. When there is ' role: > Unauthorized: Your user account is defined outside the context of > the object being accessed. Access to 'testmethod' of > (Products.Five.tests.contentspaceadapters.CacheablePlus instance at > 0x2aaab1db6128) denied. Your user account, test_user_1_, exists at > /test_folder_1_/acl_users. Access requires one of the following > roles: ['Manager']. That case says to me that your adapter factory needs to return your adapter object with an appropriate acquisition context -- otherwise, the security machinery's 'inContextOf' check will fail. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFXglC+gerLs4ltQ4RAqYhAKCs38CewMp65Kz2SeGDtXun8UCG1wCgtOoe iS2X+Ak9DTvi+NmRS64RZs0= =Vbnj -----END PGP SIGNATURE----- From maciej.wisniowski at coig.katowice.pl Fri Nov 17 20:52:21 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Fri, 17 Nov 2006 20:52:21 +0100 Subject: [z3-five] Adaptation in untrusted code In-Reply-To: <455E0942.9010605@palladion.com> References: <455B013C.20601@simplistix.co.uk> <455C73E3.5000805@coig.katowice.pl> <455D2094.1020303@palladion.com> <455DD638.8080707@coig.katowice.pl> <455E0942.9010605@palladion.com> Message-ID: <455E12F5.3090005@coig.katowice.pl> > Are they failing as checked in? They're failing. I just meant that if somebody wants to see these tests then they should be executed from Five/test directory. I have no experience with test writing, so I didn't know how do you prefer this kind of failing tests. > Looks like nobody has given the appropriate permission to 'test_role_1_' > on that object. Ehm... you are right. I've missed this. > That case says to me that your adapter factory needs to return your > adapter object with an appropriate acquisition context -- otherwise, the > security machinery's 'inContextOf' check will fail. You mean something like that: in zcml: Hi, I'm working on the listen product for a customer, and they need to be able to edit a tuple (all_subscribers property) easily. The all_subscribers property is currently edited by ticking checkboxes and filling out text fields. Is there a widget that would allow for editing a Tuple property the same way you edit a lines property in Zope 2? The current definition for the property / editing view is all_subscribers = Tuple( title = _(u"All Subscribers"), description = _(u"The ids of member subscribers and emails of non-member subscribers."), required = False, value_type = TextLine(title=_(u"User id or email address"),),) --- can I use a different widget that enables editing in a lines-like fashion, or does a new widget have to be developed? Thanks, Morten From y.2006_ at wcm-solutions.de Sat Nov 18 11:16:41 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sat, 18 Nov 2006 11:16:41 +0100 Subject: [z3-five] Widget for editing Tuple the same way lines works in Zope 2 In-Reply-To: <455E2C8E.8090300@nidelven-it.no> References: <455E2C8E.8090300@nidelven-it.no> Message-ID: <455EDD89.9010506@wcm-solutions.de> Hi Morten! Morten W. Petersen wrote: > field="all_subscribers" > class="zope.app.form.browser.sequencewidget.SequenceWidget" > /> > [...] > > can I use a different widget that enables editing in a lines-like > fashion, or does a new widget have to be developed? AFAICT Zope doesn't ship with a widget like that and I'm not aware of any third party package that does. But I needed one myself and wrote the attached code. Please let me know if you find any issues, it's not well tested. The widget might become part of CMF 2.1. Cheers, Yuppie --------------------------------------------------------------- class TupleTextAreaWidget(TextAreaWidget): implementsOnly(IInputWidget) adapts(ITuple, IBrowserRequest) def _toFieldValue(self, input): input = super(TupleTextAreaWidget, self)._toFieldValue(input) if isinstance(input, basestring): input = tuple([ l.strip() for l in input.splitlines() if l.strip() ]) if input == (): return self.context.missing_value return input def _toFormValue(self, value): if value is not None: value = u'\n'.join(value) return super(TupleTextAreaWidget, self)._toFormValue(value) From morten at nidelven-it.no Sat Nov 18 12:38:49 2006 From: morten at nidelven-it.no (Morten W. Petersen) Date: Sat, 18 Nov 2006 12:38:49 +0100 Subject: [z3-five] Widget for editing Tuple the same way lines works in Zope 2 In-Reply-To: <455EDD89.9010506@wcm-solutions.de> References: <455E2C8E.8090300@nidelven-it.no> <455EDD89.9010506@wcm-solutions.de> Message-ID: <455EF0C9.3030703@nidelven-it.no> Yuppie, > > AFAICT Zope doesn't ship with a widget like that and I'm not aware of > any third party package that does. > > But I needed one myself and wrote the attached code. Please let me > know if you find any issues, it's not well tested. The widget might > become part of CMF 2.1. Thanks for that code. I implemented the widget as a product (had to do some imports) and the product loads successfully. However, when I make use of the widget the following message appears on the edit page Error Type TypeError Error Value __init__() takes exactly 3 arguments (4 given) with the following traceback: [...] * Module zope.app.form.utility, line 224, in setUpEditWidgets * Module zope.app.form.utility, line 101, in setUpWidget * Module zope.app.form, line 120, in __call__ * Module zope.app.form, line 102, in _create Do you know what needs to be changed here for this to work? Thanks, Morten From y.2006_ at wcm-solutions.de Sat Nov 18 14:13:44 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sat, 18 Nov 2006 14:13:44 +0100 Subject: [z3-five] Widget for editing Tuple the same way lines works in Zope 2 In-Reply-To: <455EF0C9.3030703@nidelven-it.no> References: <455E2C8E.8090300@nidelven-it.no> <455EDD89.9010506@wcm-solutions.de> <455EF0C9.3030703@nidelven-it.no> Message-ID: <455F0708.4010501@wcm-solutions.de> Hi Morten! Morten W. Petersen wrote: > However, when I make use of the widget > > field="all_subscribers" > class="Products.TupleTextWidget.TupleTextAreaWidget" > /> > > the following message appears on the edit page > > Error Type > > TypeError > Error Value > __init__() takes exactly 3 arguments (4 given) > > > with the following traceback: > > [...] > > * Module zope.app.form.utility, line 224, in setUpEditWidgets > * Module zope.app.form.utility, line 101, in setUpWidget > * Module zope.app.form, line 120, in __call__ > * Module zope.app.form, line 102, in _create > > Do you know what needs to be changed here for this to work? I use it as custom_widget in formlib. In that case it is initialized with (field, request). The way you use it, the widget seems to be initialized with (field, field.value_type, request). If you can't change the way it is initialized, you have to add an __init__ method that wraps around the inherited __init__ method. field.value_type is hardcoded as tuple, so you can ignore that value. HTH, Yuppie From y.2006_ at wcm-solutions.de Sat Nov 18 14:22:57 2006 From: y.2006_ at wcm-solutions.de (yuppie) Date: Sat, 18 Nov 2006 14:22:57 +0100 Subject: [z3-five] Widget for editing Tuple the same way lines works in Zope 2 In-Reply-To: <455F0708.4010501@wcm-solutions.de> References: <455E2C8E.8090300@nidelven-it.no> <455EDD89.9010506@wcm-solutions.de> <455EF0C9.3030703@nidelven-it.no> <455F0708.4010501@wcm-solutions.de> Message-ID: <455F0931.7020604@wcm-solutions.de> yuppie wrote: > field.value_type is hardcoded as tuple, so you can ignore that value. Oops! I meant "hardcoded as text line". Yuppie From morten at nidelven-it.no Sat Nov 18 16:01:15 2006 From: morten at nidelven-it.no (Morten W. Petersen) Date: Sat, 18 Nov 2006 16:01:15 +0100 Subject: [z3-five] Widget for editing Tuple the same way lines works in Zope 2 In-Reply-To: <455F0708.4010501@wcm-solutions.de> References: <455E2C8E.8090300@nidelven-it.no> <455EDD89.9010506@wcm-solutions.de> <455EF0C9.3030703@nidelven-it.no> <455F0708.4010501@wcm-solutions.de> Message-ID: <455F203B.4060500@nidelven-it.no> Yuppie, > I use it as custom_widget in formlib. In that case it is initialized > with (field, request). The way you use it, the widget seems to be > initialized with (field, field.value_type, request). > > If you can't change the way it is initialized, you have to add an > __init__ method that wraps around the inherited __init__ method. > > field.value_type is hardcoded as tuple, so you can ignore that value. Aha. OK. ;) Well it works now and if anyone wants it, I have the lines-like widget available as a product. Thanks very much for your help. Regards, Morten From d.schulz81 at gmx.net Mon Nov 20 22:43:24 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Mon, 20 Nov 2006 22:43:24 +0100 Subject: [z3-five] add zope 2 object instance using five view Message-ID: <4562217C.4040807@gmx.net> Hi, how to make a Zope 2 Instance of an object that has an adding view with a call method def __call__(self, add_input_name='', domain_class='', title='', submit_add=''): The following code doues not work: obj = current_object new = obj.manage_addProduct['alchemist'].add-container(x,x,x) Dennis From maciej.wisniowski at coig.katowice.pl Mon Nov 20 22:59:04 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Mon, 20 Nov 2006 22:59:04 +0100 Subject: [z3-five] add zope 2 object instance using five view In-Reply-To: <4562217C.4040807@gmx.net> References: <4562217C.4040807@gmx.net> Message-ID: <45622528.2060203@coig.katowice.pl> > how to make a Zope 2 Instance of an object that has an adding view with > a call method > > def __call__(self, add_input_name='', domain_class='', title='', > submit_add=''): > > The following code doues not work: > > obj = current_object > new = obj.manage_addProduct['alchemist'].add-container(x,x,x) > You want to create an instance of a class or instance of a class and add this to 'obj'??? Maybe something like: # if you have product alchemist with alchemist.py and Alchemist class # inside from Products.alchemist.alchemist import Alchemist obj = current_object obj._setObject('objectid', Alchemist(?, ?, ?)) I'm not sure what you want to do. -- Maciej Wisniowski From d.schulz81 at gmx.net Wed Nov 22 16:12:43 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Wed, 22 Nov 2006 16:12:43 +0100 Subject: [z3-five] traversal parents Message-ID: <456468EB.9020106@gmx.net> Hi, I had some problems struggling with linking to parent objects. I am using an alchemist container as container object that maps domain classes inside. Now I want to link back from the edit form directly to the table view. the domain classes and container are traversable with . So the objects should be zope 2 traversable. However the zope 2 traversal only works until the domain class. For example I am in suppliers/7/supplieredit after calling return self.request.RESPONSE.redirect( self.context.aq_parent.context.aq_parent.context.absolute_url() ) i still only get suppliers/7 (I would like to go up 2 parents) Trying Zope 3 traversal with parent = zapi.getParent(self.context) I got the error: not enough context information Dennis From chris at simplistix.co.uk Wed Nov 22 16:52:00 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Wed, 22 Nov 2006 15:52:00 +0000 Subject: [z3-five] weird security problem with Five.browser.BrowserView Message-ID: <45647220.3040202@simplistix.co.uk> Hi All, Got a strange security problem for a view registered as follows: The view class is: from Products.Five.browser import BrowserView class Contents(BrowserView): highlight_tab = '@@contents' content.pt is: ... main_template.pt is an FS ZPT in a skins folder: Now, all works well, except that if I enable the view/highlight_tab statement in main_template.pt, I get an Unauthorized error on 'highlight_tab'. If checked that everything appears to be acquisition wrapped as it should. I've even tried changing the view registration to: ...and the view class to: class Contents(BrowserView): security = ClassSecurityInfo() security.declareObjectPublic() security.setDefaultAccess('allow') highlight_tab='@@contents' ...all to no avail. It seems the security machinery is trying to establing the acquisition contents of '@@contents', which of course has no aq context 'cos it's only a simple string. The only think I have found which does work is changing the view class definition to: class Contents(BrowserView): def highlight_tab(self): 'cluck cluck' return '@@contents' ...but that seems a bit nasty. I haven't had this kind of problem with "normal" Zope 2 classes, so I'm wondering what's going on here to cause these problems? any ideas? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From d.schulz81 at gmx.net Wed Nov 22 19:06:23 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Wed, 22 Nov 2006 19:06:23 +0100 Subject: [z3-five] traversal parents In-Reply-To: <456468EB.9020106@gmx.net> References: <456468EB.9020106@gmx.net> Message-ID: <4564919F.3050009@gmx.net> Ok, return self.request.response.redirect("..") did it. Dennis Schulz escribi?: > Hi, > > I had some problems struggling with linking to parent objects. > > I am using an alchemist container as container object that maps domain > classes inside. > Now I want to link back from the edit form directly to the table view. > > the domain classes and container are traversable with class=".domain.DomainRecord" />. > > So the objects should be zope 2 traversable. > However the zope 2 traversal only works until the domain class. > > For example I am in > suppliers/7/supplieredit > > after calling > return self.request.RESPONSE.redirect( > self.context.aq_parent.context.aq_parent.context.absolute_url() ) > > i still only get suppliers/7 (I would like to go up 2 parents) > > Trying Zope 3 traversal with > parent = zapi.getParent(self.context) > I got the error: not enough context information > > > Dennis > > > > > > > > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > > > From r.ritz at biologie.hu-berlin.de Thu Nov 23 10:09:52 2006 From: r.ritz at biologie.hu-berlin.de (Raphael Ritz) Date: Thu, 23 Nov 2006 10:09:52 +0100 Subject: [z3-five] weird security problem with Five.browser.BrowserView In-Reply-To: <45647220.3040202@simplistix.co.uk> References: <45647220.3040202@simplistix.co.uk> Message-ID: Chris Withers schrieb: > Hi All, > Hi Chris, [..] > from Products.Five.browser import BrowserView > > class Contents(BrowserView): > > highlight_tab = '@@contents' > Wild guess: what if you give this class a doc-string? Raphael From chris at simplistix.co.uk Fri Nov 24 11:44:02 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 24 Nov 2006 10:44:02 +0000 Subject: [z3-five] testing Five-ish products Message-ID: <4566CCF2.20706@simplistix.co.uk> Hi all, What's the "correct" way to do functional tests for a Five-ish product, I'm trying to do the following: (apologies for the length, gotta love the amount of kicking Zope 2 needs ;-) import Globals import logging import transaction import Zope2 from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import noSecurityManager # this import, rather evilly, causes Zope2.bobo_application and Zope2.DB # to come into existence :-( from Testing.ZopeTestCase import ZopeLite from Testing.ZopeTestCase.utils import makerequest from ZODB import DB from ZODB.DemoStorage import DemoStorage state = [Zope2.DB] def setChickens(db): # Zope 2 chickens Globals.BobobaseName = db.getName() Globals.DB = db Zope2.DB = db Globals.UndoManager=db ZopeLite.DB = db junk_db, name, version_support = Zope2.bobo_application._stuff Zope2.bobo_application._stuff = db, name, version_support def addDB(): global state previous = state[-1] storage = DemoStorage(base=previous._storage) db = DB(storage) # cluck db.classFactory = previous.classFactory # cluck cluck setChickens(db) state.append(db) def removeDB(): global state db = state.pop() db.close() # un-cluck setChickens(state[-1]) def Zope2SetUp(test): global state previous = state[-1] storage = DemoStorage(base=previous._storage) db = DB(storage) # cluck db.classFactory = previous.classFactory # cluck cluck setChickens(db) state.append(db) # install product ZopeLite.installProduct('Five') ZopeLite.installProduct('twiddler.zope2') def Zope2TearDown(test): global state db = state.pop() db.close() # un-cluck setChickens(state[-1]) def setUp(test): Zope2SetUp(test) a = app() a.manage_addFolder('folder') test.globs['folder']=a.folder def test_suite(): return unittest.TestSuite(( DocFileSuite('../readme.txt', optionflags=options, setUp=setUp, tearDown=Zope2TearDown), )) I get the following error: File "C:\Zope\2.9.4\lib\python\zope\configuration\config.py", line 612, in execute_actions callable(*args, **kw) File "Products\pythonproducts\pythonproducts.py", line 57, in _registerPackage _zope_app) File "C:\Zope\2.9.4\lib\python\App\Product.py", line 497, in initializeProduct products=app.Control_Panel.Products ConfigurationExecutionError: exceptions.AttributeError: 'NoneType' object has no attribute 'Control_Panel' in: File "lib\python\twiddler\zope2\configure.zcml", line 6.0-6.61 If I remove the installProduct('Five'), I get the following instead: File "", line 1, in ? folder.manage_addProduct['twiddler.zope2'].addTwiddler('test') File "C:\Zope\2.9.4\lib\python\App\FactoryDispatcher.py", line 26, in __getitem__ return self.__bobo_traverse__(None, name) File "C:\Zope\2.9.4\lib\python\App\FactoryDispatcher.py", line 29, in __bobo_traverse__ product=self.aq_acquire('_getProducts')()._product(name) File "C:\Zope\2.9.4\lib\python\App\Product.py", line 69, in _product def _product(self, name): return getattr(self, name) AttributeError: twiddler.zope2 Any help greatfully received... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Fri Nov 24 17:09:38 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Fri, 24 Nov 2006 16:09:38 +0000 Subject: [z3-five] weird security problem with Five.browser.BrowserView In-Reply-To: References: <45647220.3040202@simplistix.co.uk> Message-ID: <45671942.2010408@simplistix.co.uk> Raphael Ritz wrote: >> class Contents(BrowserView): >> >> highlight_tab = '@@contents' >> > Wild guess: what if you give this class a doc-string? Doesn't make a difference... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From d.schulz81 at gmx.net Fri Nov 24 17:50:01 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 24 Nov 2006 17:50:01 +0100 Subject: [z3-five] Azax Error looking for directive Message-ID: <456722B9.9030704@gmx.net> I am getting this error when installing Azax on Plone 2.5.1, Zope 2.9.5, Five 1.4.2. What do I have to do to register the new directive? ZopeXMLConfigurationError: File "C:\PLONE\Data\Products\PloneAzax\configure.zcml", line 10.4-10.33 ZopeXMLConfigurationError: File "C:\PLONE\Data\Products\PloneAzax\plugins\configure.zcml", line 11.2-11.31 ZopeXMLConfigurationError: File "C:\PLONE\Data\Products\PloneAzax\plugins\legacy\configure.zcml", line 9.4 ConfigurationError: ('Unknown directive', u'http://namespaces.zope.org/azax', u'registerAction') From tseaver at palladion.com Fri Nov 24 18:25:34 2006 From: tseaver at palladion.com (Tres Seaver) Date: Fri, 24 Nov 2006 12:25:34 -0500 Subject: [z3-five] Azax Error looking for directive In-Reply-To: <456722B9.9030704@gmx.net> References: <456722B9.9030704@gmx.net> Message-ID: <45672B0E.6060800@palladion.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Dennis Schulz wrote: > I am getting this error when installing Azax on Plone 2.5.1, Zope 2.9.5, > Five 1.4.2. > What do I have to do to register the new directive? > > > ZopeXMLConfigurationError: File > "C:\PLONE\Data\Products\PloneAzax\configure.zcml", line 10.4-10.33 > ZopeXMLConfigurationError: File > "C:\PLONE\Data\Products\PloneAzax\plugins\configure.zcml", line 11.2-11.31 > ZopeXMLConfigurationError: File > "C:\PLONE\Data\Products\PloneAzax\plugins\legacy\configure.zcml", line 9.4 > ConfigurationError: ('Unknown directive', > u'http://namespaces.zope.org/azax', u'registerAction') > > > > > > > > xmlns:browser="http://namespaces.zope.org/browser" > xmlns:azax="http://namespaces.zope.org/azax" > > > > > name="bindActionMenus" > jsfile="reload/bindmenus.js" > /> > > name="initializeCollapsible" > jsfile="reload/initializeCollapsible.js" > /> > > You need to include the meta.zcml which defines the directive, e.g. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver at palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFZysO+gerLs4ltQ4RAlI3AJ9tllcpv1mWcOV74PBvS0P18A0TzACfRBd2 LfxhOlttEnvW6DOD7KuMjQg= =nCkr -----END PGP SIGNATURE----- From ree at ree.hu Fri Nov 24 18:34:10 2006 From: ree at ree.hu (Balazs Ree) Date: Fri, 24 Nov 2006 18:34:10 +0100 Subject: [z3-five] Azax Error looking for directive References: <456722B9.9030704@gmx.net> Message-ID: On Fri, 24 Nov 2006 17:50:01 +0100 Dennis Schulz wrote: > I am getting this error when installing Azax on Plone 2.5.1, Zope 2.9.5, > Five 1.4.2. > What do I have to do to register the new directive? Please install product "azax" from the bundle as well. If you have done so, and the problem still persists, then please issue a bugreport on plone.org in the product area. (Although I really believe that the problem is with your installation, in this case. The directives are installed by Products.azax.) -- Balazs Ree From d.schulz81 at gmx.net Fri Nov 24 22:26:54 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 24 Nov 2006 22:26:54 +0100 Subject: [z3-five] Azax Error looking for directive In-Reply-To: References: <456722B9.9030704@gmx.net> Message-ID: <4567639E.7050903@gmx.net> I just installed all of the included products azax, azaxdemo, PloneOnAzax and livesearch and got the error. Balazs Ree escribi?: > On Fri, 24 Nov 2006 17:50:01 +0100 Dennis Schulz wrote: > > >> I am getting this error when installing Azax on Plone 2.5.1, Zope 2.9.5, >> Five 1.4.2. >> What do I have to do to register the new directive? >> > > Please install product "azax" from the bundle as well. If you have done so, > and the problem still persists, then please issue a bugreport on > plone.org in the product area. (Although I really believe that the problem > is with your installation, in this case. The directives are installed by > Products.azax.) > > From ree at ree.hu Sat Nov 25 08:10:11 2006 From: ree at ree.hu (Balazs Ree) Date: Sat, 25 Nov 2006 08:10:11 +0100 Subject: [z3-five] Azax Error looking for directive References: <456722B9.9030704@gmx.net> <45672B0E.6060800@palladion.com> Message-ID: On Fri, 24 Nov 2006 12:25:34 -0500 Tres Seaver wrote: > You need to include the meta.zcml which defines the directive, e.g. > > This would be normally true, but we do that already. Since the meta.zcml-s in Products are picked up automatically by Five, it is hard to imagine how it would not be executed - given that the "azax" product is installed properly. This is the reason why can only repeat myself and suggest the OP: please check your installation, and if the problem still persists, please file a bug report. There is nothing more to be said on this mailing list: since this problem is very unlikely to be related to Five itself. (I know there is no dedicated list to KSS yet at the moment: but still.) -- Balazs Ree From d.schulz81 at gmx.net Sat Nov 25 15:36:40 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Sat, 25 Nov 2006 15:36:40 +0100 Subject: [z3-five] object widget in zope 2 Message-ID: <456854F8.2030604@gmx.net> Hi, I tried to build an object widget like here. However Five can't recognize the type and factory attributes in the zcml. how to register the widget to the object interface programmatically? http://mail.zope.org/pipermail/zope3-users/2006-May/003451.html Dennis From chris at simplistix.co.uk Mon Nov 27 17:31:13 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Mon, 27 Nov 2006 16:31:13 +0000 Subject: [z3-five] still trying to test a Zope 2 package :-s Message-ID: <456B12D1.3090604@simplistix.co.uk> Hi All, I'm still finding it impossible to test twiddler.zope2, a python package which _works_ with Zope 2.9.4, Five and pythonproducts, but which I'm having a tough time trying to test :-S I want to be able to do: >>> folder.manage_addProduct['twiddler.zope2'].addTwiddler('test') ...with the following in the DocTest's setUp function: a = app() a.manage_addFolder('folder') test.globs['folder']=a.folder But where do I import app from and what do I set up to make it all work? My previous post (http://codespeak.net/pipermail/z3-five/2006q4/001960.html) gets a ZODB set up just fine, but I can't seem to get the python product installed :-S My latest attempt was to try and manually get the zcml set up: ZopeLite.installProduct('pythonproducts',quiet=True) zcml.load_config('meta.zcml', Products.Five) zcml.load_config('meta.zcml', Products.pythonproducts) zcml.load_config('configure.zcml', twiddler.zope2) This gave me the following exception: File "\Products\pythonproducts\pythonproducts.py", line 57, in _registerPackage _zope_app) File "C:\Zope\2.9.4\lib\python\App\Product.py", line 497, in initializeProduct products=app.Control_Panel.Products ConfigurationExecutionError: exceptions.AttributeError: 'NoneType' object has no attribute 'Control_Panel' in: File "\lib\python\twiddler\zope2\configure.zcml", line 6.0-6.61 Can anyone make any suggestions about how I should be trying to do this test setup? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Mon Nov 27 18:18:27 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Mon, 27 Nov 2006 17:18:27 +0000 Subject: [z3-five] still trying to test a Zope 2 package :-s In-Reply-To: References: <456B12D1.3090604@simplistix.co.uk> Message-ID: <456B1DE3.8010600@simplistix.co.uk> Sidnei da Silva wrote: > it would just work. I'm just wondering if installProduct accepts > Python Packages. I don't think it does from my experience. Anyone? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From maciej.wisniowski at coig.katowice.pl Mon Nov 27 19:24:25 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Mon, 27 Nov 2006 19:24:25 +0100 Subject: [z3-five] still trying to test a Zope 2 package :-s In-Reply-To: <456B12D1.3090604@simplistix.co.uk> References: <456B12D1.3090604@simplistix.co.uk> Message-ID: <456B2D59.3000106@coig.katowice.pl> > I'm still finding it impossible to test twiddler.zope2, a python package > which _works_ with Zope 2.9.4, Five and pythonproducts, but which I'm > having a tough time trying to test :-S (...) > Can anyone make any suggestions about how I should be trying to do > this test setup? This will possibly not help you but I had some problems running tests that are using Five and solution was to use method described in Five/testing/README to execute tests. This was on Zope 2.8 so, as you're using 2.9, it is possibly not what you're looking for, but maybe you'll find this helpful somehow. -- Maciej Wisniowski From ra at burningman.com Tue Nov 28 06:35:48 2006 From: ra at burningman.com (Rob Miller) Date: Mon, 27 Nov 2006 21:35:48 -0800 Subject: [z3-five] five:localsite zcml conflicts w/ Five 1.4 Message-ID: hi there, i'm using the Five 1.4 branch w/ Zope 2.9 branch, and am having problems b/c multiple products want the same classes to be declared as possible local sites. using the tag in multiple places for the same class will cause a ZCML conflict error. even using overrides.zcml just buys you one more location you can declare it. is there a safe way to do this with ZCML? the only way i can think of to work around this for now is to put some code in my package initialization routine that will inspect the classes and then call zcml.load_string with the five:localsite tag if necessary. is there no better way? -r From rocky at serverzen.com Tue Nov 28 13:32:57 2006 From: rocky at serverzen.com (Rocky Burt) Date: Tue, 28 Nov 2006 09:02:57 -0330 Subject: [z3-five] five:localsite zcml conflicts w/ Five 1.4 In-Reply-To: References: Message-ID: <1164717169.28767.40.camel@localhost> On Mon, 2006-27-11 at 21:35 -0800, Rob Miller wrote: > i'm using the Five 1.4 branch w/ Zope 2.9 branch, and am having problems b/c > multiple products want the same classes to be declared as possible local > sites. using the tag in multiple places for the same class > will cause a ZCML conflict error. even using overrides.zcml just buys you one > more location you can declare it. > > is there a safe way to do this with ZCML? the only way i can think of to work > around this for now is to put some code in my package initialization routine > that will inspect the classes and then call zcml.load_string with the > five:localsite tag if necessary. is there no better way? This sounds like a bug to me. five:localsite should react like five:traverseable, that is it shouldn't have any discriminator and if you try running it more than once on the same class, the additional calls should simply have no effect. Of course with Zope 2.10 I believe we won't have this problem since all ObjectManager's are IPossibleSite's to begin with. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061128/6dca0a87/attachment.pgp From d.schulz81 at gmx.net Tue Nov 28 14:21:19 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Tue, 28 Nov 2006 14:21:19 +0100 Subject: [z3-five] [Zope3-Users] Select Field with Widget Message-ID: <456C37CF.8020808@gmx.net> Hello, I made a select field that works on the add form (formlib) without any problems. However, in the edit form I have always an attribute error. I think there should not be any problems on vocabulary etc since the add form can render without any problems and custom widgets. Maybe there is a problem with default values? How is it possible to set the selected value in a SelectWidget? Zope 2.9.5, Plone 2.5.1, Five 1.4.2 Dennis Traceback (innermost last): Module ZPublisher.Publish, line 115, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 41, in call_object Module zope.formlib.form, line 757, in __call__ Module Products.PurchaseRequisition.browser.supplier, line 564, in update Module Products.Five.formlib.formbase, line 54, in update Module zope.formlib.form, line 720, in update Module zope.formlib.form, line 790, in setUpWidgets Module zope.formlib.form, line 385, in setUpEditWidgets Module zope.schema._bootstrapfields, line 171, in get AttributeError: countrySelect Here is the field in the interface: countrySelect = Choice( title=u"countrySelect", description=u"countrySelect", values=vocabulary) Here is the editForm: class SupplierEditView( formbase.EditFormBase ): """ Support View for Edit Form """ def __init__(self, context, request): formbase.EditFormBase.__init__(self, context, request) self.request.SESSION['supplierform'] = 'edit' form_fields = form.Fields(prInterfaces.ISupplierTable, for_input=True) form_fields= form_fields.omit('isDeleted','pr_supplier_ID','pr_country_ID') template = ZopeTwoPageTemplateFile('www/supplier_pageform.pt') prefix = 'edit' _______________________________________________ Zope3-users mailing list Zope3-users at zope.org http://mail.zope.org/mailman/listinfo/zope3-users From chris at simplistix.co.uk Tue Nov 28 19:05:04 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Tue, 28 Nov 2006 18:05:04 +0000 Subject: [z3-five] still trying to test a Zope 2 package :-s In-Reply-To: <456B2D59.3000106@coig.katowice.pl> References: <456B12D1.3090604@simplistix.co.uk> <456B2D59.3000106@coig.katowice.pl> Message-ID: <456C7A50.6010105@simplistix.co.uk> Maciej Wisniowski wrote: > This will possibly not help you but I had some problems running tests > that are using Five and solution was to use method described in > Five/testing/README to execute tests. You mean Five/tests/README.txt or something else? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From maciej.wisniowski at coig.katowice.pl Tue Nov 28 21:43:11 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Tue, 28 Nov 2006 21:43:11 +0100 Subject: [z3-five] still trying to test a Zope 2 package :-s In-Reply-To: <456C7A50.6010105@simplistix.co.uk> References: <456B12D1.3090604@simplistix.co.uk> <456B2D59.3000106@coig.katowice.pl> <456C7A50.6010105@simplistix.co.uk> Message-ID: <456C9F5F.706@coig.katowice.pl> > You mean Five/tests/README.txt or something else? Five/testing/README, but as I said this was in Zope 2.8 (and Five 1.2.6) so it may be not present in newer Five releases... Yes... I see there is a note: """ Nota Bene --------- This package will be removed from Five as of version 1.3, at which point the new 'zope.testing' code should be available in the Zope 2.9 / Zope 3.2 tree. Please do not add unnecessary dependencies, beyond using the testrunner as described below. """ -- Maciej Wisniowski From ra at burningman.com Wed Nov 29 02:52:12 2006 From: ra at burningman.com (Rob Miller) Date: Tue, 28 Nov 2006 17:52:12 -0800 Subject: [z3-five] five:localsite zcml conflicts w/ Five 1.4 In-Reply-To: <1164717169.28767.40.camel@localhost> References: <1164717169.28767.40.camel@localhost> Message-ID: <456CE7CC.3070803@burningman.com> Rocky Burt wrote: > On Mon, 2006-27-11 at 21:35 -0800, Rob Miller wrote: >> i'm using the Five 1.4 branch w/ Zope 2.9 branch, and am having problems b/c >> multiple products want the same classes to be declared as possible local >> sites. using the tag in multiple places for the same class >> will cause a ZCML conflict error. even using overrides.zcml just buys you one >> more location you can declare it. >> >> is there a safe way to do this with ZCML? the only way i can think of to work >> around this for now is to put some code in my package initialization routine >> that will inspect the classes and then call zcml.load_string with the >> five:localsite tag if necessary. is there no better way? > > This sounds like a bug to me. five:localsite should react like > five:traverseable, that is it shouldn't have any discriminator and if > you try running it more than once on the same class, the additional > calls should simply have no effect. okay, considering it to be a bug, i've committed a fix on the 1.4 branch (r71325). > Of course with Zope 2.10 I believe we won't have this problem since all > ObjectManager's are IPossibleSite's to begin with. does that mean i don't need to fix it in 1.5? also, my products require 1.4, but should i backport this to 1.3? /me is not up on which Five branches should get which changes. -r From philipp at weitershausen.de Wed Nov 29 10:21:00 2006 From: philipp at weitershausen.de (Philipp von Weitershausen) Date: Wed, 29 Nov 2006 10:21:00 +0100 Subject: [z3-five] five:localsite zcml conflicts w/ Five 1.4 In-Reply-To: <456CE7CC.3070803@burningman.com> References: <1164717169.28767.40.camel@localhost> <456CE7CC.3070803@burningman.com> Message-ID: <456D50FC.7020009@weitershausen.de> Rob Miller wrote: > Rocky Burt wrote: >> On Mon, 2006-27-11 at 21:35 -0800, Rob Miller wrote: >>> i'm using the Five 1.4 branch w/ Zope 2.9 branch, and am having problems b/c >>> multiple products want the same classes to be declared as possible local >>> sites. using the tag in multiple places for the same class >>> will cause a ZCML conflict error. even using overrides.zcml just buys you one >>> more location you can declare it. >>> >>> is there a safe way to do this with ZCML? the only way i can think of to work >>> around this for now is to put some code in my package initialization routine >>> that will inspect the classes and then call zcml.load_string with the >>> five:localsite tag if necessary. is there no better way? >> This sounds like a bug to me. five:localsite should react like >> five:traverseable, that is it shouldn't have any discriminator and if >> you try running it more than once on the same class, the additional >> calls should simply have no effect. > > okay, considering it to be a bug, i've committed a fix on the 1.4 branch (r71325). Thanks. >> Of course with Zope 2.10 I believe we won't have this problem since all >> ObjectManager's are IPossibleSite's to begin with. > > does that mean i don't need to fix it in 1.5? No, please do fix it there. Five.site exists in 1.5 and the trunk. Hence both branches need to be updated as well. > also, my products require 1.4, but should i backport this to 1.3? Yes please. -- http://worldcookery.com -- Professional Zope documentation and training From chris at simplistix.co.uk Wed Nov 29 11:48:59 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Wed, 29 Nov 2006 10:48:59 +0000 Subject: [z3-five] Five.traversable masking errors in views Message-ID: <456D659B.8030104@simplistix.co.uk> Hi All, Just been head scratching while trying to debug an AttributeError. I was getting an AttributeError on @@myviewname. It was only from pdb'ing through traversable.py that I found that the except clause in line 114 of traversable.py was swallowing an AttributeError and re-raising an attribute error on the view name :-( Is this really sane? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From d.schulz81 at gmx.net Wed Nov 29 19:07:58 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Wed, 29 Nov 2006 19:07:58 +0100 Subject: [z3-five] formlib widgets access without repeat Message-ID: <456DCC7E.2070204@gmx.net> in a formlib based form I would like to have more control over the rendering of the widgets. is it possible to call widget with a specific name directly instead of running through all on a repeat loop? for example

I saw that there is a get method but I can't access it form the page template. Dennis From apm13 at columbia.edu Wed Nov 29 21:38:10 2006 From: apm13 at columbia.edu (Alec Mitchell) Date: Wed, 29 Nov 2006 12:38:10 -0800 Subject: [z3-five] Five.traversable masking errors in views In-Reply-To: <456D659B.8030104@simplistix.co.uk> References: <456D659B.8030104@simplistix.co.uk> Message-ID: <365118370611291238l1abd27b3t352a18009141376c@mail.gmail.com> On 11/29/06, Chris Withers wrote: > Hi All, > > Just been head scratching while trying to debug an AttributeError. > > I was getting an AttributeError on @@myviewname. It was only from > pdb'ing through traversable.py that I found that the except clause in > line 114 of traversable.py was swallowing an AttributeError and > re-raising an attribute error on the view name :-( > > Is this really sane? It's probably a good idea to fix this by saving the original exception and raising it later if necessary. Even better would be if we could discriminate between those attribute errors which are due to lookup failures, and those that are de to code bugs, and raise the latter immediately. Any ideas? Alec From chris at simplistix.co.uk Thu Nov 30 11:11:42 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 30 Nov 2006 10:11:42 +0000 Subject: [z3-five] Five.traversable masking errors in views In-Reply-To: <365118370611291238l1abd27b3t352a18009141376c@mail.gmail.com> References: <456D659B.8030104@simplistix.co.uk> <365118370611291238l1abd27b3t352a18009141376c@mail.gmail.com> Message-ID: <456EAE5E.303@simplistix.co.uk> Alec Mitchell wrote: > It's probably a good idea to fix this by saving the original exception > and raising it later if necessary. Even better would be if we could > discriminate between those attribute errors which are due to lookup > failures, and those that are de to code bugs, and raise the latter > immediately. Any ideas? Well, LookupError is explicitly caught. Can whoever wrote that code explain the legitimate reasons for catching AttributeErrors and the like? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From ra at burningman.com Thu Nov 30 23:39:34 2006 From: ra at burningman.com (Rob Miller) Date: Thu, 30 Nov 2006 14:39:34 -0800 Subject: [z3-five] five:localsite zcml conflicts w/ Five 1.4 In-Reply-To: <456D50FC.7020009@weitershausen.de> References: <1164717169.28767.40.camel@localhost> <456CE7CC.3070803@burningman.com> <456D50FC.7020009@weitershausen.de> Message-ID: Philipp von Weitershausen wrote: > Rob Miller wrote: >> Rocky Burt wrote: >>> On Mon, 2006-27-11 at 21:35 -0800, Rob Miller wrote: >>>> i'm using the Five 1.4 branch w/ Zope 2.9 branch, and am having problems b/c >>>> multiple products want the same classes to be declared as possible local >>>> sites. using the tag in multiple places for the same class >>>> will cause a ZCML conflict error. even using overrides.zcml just buys you one >>>> more location you can declare it. >>>> >>>> is there a safe way to do this with ZCML? the only way i can think of to work >>>> around this for now is to put some code in my package initialization routine >>>> that will inspect the classes and then call zcml.load_string with the >>>> five:localsite tag if necessary. is there no better way? >>> This sounds like a bug to me. five:localsite should react like >>> five:traverseable, that is it shouldn't have any discriminator and if >>> you try running it more than once on the same class, the additional >>> calls should simply have no effect. >> okay, considering it to be a bug, i've committed a fix on the 1.4 branch (r71325). > > Thanks. > >>> Of course with Zope 2.10 I believe we won't have this problem since all >>> ObjectManager's are IPossibleSite's to begin with. >> does that mean i don't need to fix it in 1.5? > > No, please do fix it there. Five.site exists in 1.5 and the trunk. Hence > both branches need to be updated as well. > >> also, my products require 1.4, but should i backport this to 1.3? > > Yes please. okay, the change is now in Five 1.3, 1.4, 1.5, and trunk. -r From regebro at gmail.com Fri Dec 1 12:31:58 2006 From: regebro at gmail.com (Lennart Regebro) Date: Fri, 1 Dec 2006 12:31:58 +0100 Subject: [z3-five] still trying to test a Zope 2 package :-s In-Reply-To: <456B1DE3.8010600@simplistix.co.uk> References: <456B12D1.3090604@simplistix.co.uk> <456B1DE3.8010600@simplistix.co.uk> Message-ID: <319e029f0612010331p6fd88ffdn1d611e1159060b25@mail.gmail.com> On 11/27/06, Chris Withers wrote: > Sidnei da Silva wrote: > > it would just work. I'm just wondering if installProduct accepts > > Python Packages. > > I don't think it does from my experience. Rocky was working on making it Zope accept Python Packages as products. I don't know if that included installProduct, but I guess it should. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From zope-mailinglist at mopa.at Fri Dec 1 17:25:16 2006 From: zope-mailinglist at mopa.at (Bernd Dorn) Date: Fri, 1 Dec 2006 17:25:16 +0100 Subject: [z3-five] formlib widgets access without repeat In-Reply-To: <456DCC7E.2070204@gmx.net> References: <456DCC7E.2070204@gmx.net> Message-ID: <45F36D62-9F8D-48B3-BEBC-23EDD0091068@mopa.at> On 29.11.2006, at 19:07, Dennis Schulz wrote: > in a formlib based form I would like to have more control over the > rendering of the widgets. > is it possible to call widget with a specific name directly instead of > running through all on a repeat loop? > for example > >
you cant mix python and path syntax use this: python:view.widgets.get(name) > > I saw that there is a get method but I can't access it form the page > template. > > Dennis > > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five From chris at simplistix.co.uk Tue Dec 5 08:55:06 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Tue, 05 Dec 2006 07:55:06 +0000 Subject: [z3-five] still trying to test a Zope 2 package :-s In-Reply-To: <319e029f0612010331p6fd88ffdn1d611e1159060b25@mail.gmail.com> References: <456B12D1.3090604@simplistix.co.uk> <456B1DE3.8010600@simplistix.co.uk> <319e029f0612010331p6fd88ffdn1d611e1159060b25@mail.gmail.com> Message-ID: <457525DA.7070301@simplistix.co.uk> Lennart Regebro wrote: > Rocky was working on making it Zope accept Python Packages as > products. I don't know if that included installProduct, but I guess it > should. Yeah, for now I'm reduced to the old fashioned big hammer approach: import Testing import Zope2 app = Zope2.app() :-( Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From chris at simplistix.co.uk Thu Dec 7 10:48:13 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Thu, 07 Dec 2006 09:48:13 +0000 Subject: [z3-five] MailHosts as utilities Message-ID: <4577E35D.6030805@simplistix.co.uk> Hi All, Anyone done any work on writing an interface for MailHost-like things and then getting MailHost, MaildropHost, SecureMailHost and friends to implement the interface and be registered as local utilities? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From regebro at gmail.com Thu Dec 7 12:20:21 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu, 7 Dec 2006 12:20:21 +0100 Subject: [z3-five] MailHosts as utilities In-Reply-To: <4577E35D.6030805@simplistix.co.uk> References: <4577E35D.6030805@simplistix.co.uk> Message-ID: <319e029f0612070320y5e6e84c0ye466d68acfb0b5d0@mail.gmail.com> On 12/7/06, Chris Withers wrote: > Anyone done any work on writing an interface for MailHost-like things > and then getting MailHost, MaildropHost, SecureMailHost and friends to > implement the interface and be registered as local utilities? I think Zope3 actually may have some stuff like that. CPSMailAccess uses it, I think. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From lists at zopyx.com Thu Dec 7 12:26:00 2006 From: lists at zopyx.com (Andreas Jung) Date: Thu, 07 Dec 2006 12:26:00 +0100 Subject: [z3-five] MailHosts as utilities In-Reply-To: <319e029f0612070320y5e6e84c0ye466d68acfb0b5d0@mail.gmail.com> References: <4577E35D.6030805@simplistix.co.uk> <319e029f0612070320y5e6e84c0ye466d68acfb0b5d0@mail.gmail.com> Message-ID: <86D9AF3A9BF3B999CD88A467@suxmac2.local> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 - --On 7. Dezember 2006 12:20:21 +0100 Lennart Regebro wrote: > On 12/7/06, Chris Withers wrote: >> Anyone done any work on writing an interface for MailHost-like things >> and then getting MailHost, MaildropHost, SecureMailHost and friends to >> implement the interface and be registered as local utilities? > > I think Zope3 actually may have some stuff like that. CPSMailAccess > uses it, I think. > > zope.sendmail? - -aj -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFd/pJCJIWIbr9KYwRAqYIAJ0dFqeAmWpIpWxZKMV2Z3Bt6xyrBgCdESI3 NEW/33fw3emuCwO1ZKtKtwc= =4b5Q -----END PGP SIGNATURE----- From d.schulz81 at gmx.net Thu Dec 7 12:58:49 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Thu, 07 Dec 2006 12:58:49 +0100 Subject: [z3-five] Widget Error on direct __call__ with pt Message-ID: <457801F9.7070105@gmx.net> Hello, I am using the following code for a sequence widget, based on the objectwidget in Five 1.4.2 class TableRecordSequenceWidget(ListSequenceWidget): def __init__(self, context, field, request, template_='', subwidget=None): super(TableRecordSequenceWidget, self).__init__( context, field, request, subwidget) def __call__(self): .... render sth........ It works good as long as I write the rendered html directly in the __call__ method. But I would really like to have it in a page template for cleaner developing. However when I try to change it to return a page template in the call method, (like I found it in many examples) def __call__(self): class TemplateObjectWidgetView(ObjectWidgetView): template = ZopeTwoPageTemplateFile("itemwidget.pt") template = TemplateObjectWidgetView(self, self.request) return template() I have the following error: Any help? Again, the version without the page template works perfectly The error occurs when try to get the widget structure of the objectwidget in my page tamplate:
In the earlier version (with the html dirctly in the call method) it was necessary to initialize the whole object widget like this. And now? Maybe is a problem with ZopeTwoPageTemplateFile? Module ZPublisher.Publish, line 115, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 41, in call_object Module zope.formlib.form, line 898, in __call__ Module zope.formlib.form, line 892, in render Module Shared.DC.Scripts.Bindings, line 311, in __call__ Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 113, in _exec Module Products.PageTemplates.PageTemplate, line 104, in pt_render - Module TAL.TALInterpreter, line 238, in __call__ Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 749, in do_useMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 749, in do_useMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 780, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 728, in do_defineMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 772, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 728, in do_defineMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 780, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 772, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 749, in do_useMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 780, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 749, in do_useMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 749, in do_useMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 647, in do_insertStructure_tal Module Products.PageTemplates.TALES, line 221, in evaluate - URL: index - Line 286, Column 4 - Expression: standard:'widget' - Names: {'container': , 'context': , 'default': , 'here': , 'loop': , 'modules': , 'nothing': None, 'options': {'args': ()}, 'repeat': , 'request': , 'root': , 'template': , 'traverse_subpath': [], 'user': , 'view': , 'views': } Module Products.PageTemplates.Expressions, line 185, in __call__ Module Products.PageTemplates.Expressions, line 180, in _eval Module Products.PageTemplates.Expressions, line 85, in render Module Products.PurchaseRequisition.browser.objectwidget, line 386, in __call__ Module zope.app.form.browser.objectwidget, line 41, in __call__ Module Shared.DC.Scripts.Bindings, line 311, in __call__ Module Shared.DC.Scripts.Bindings, line 346, in _bindAndExec Module Shared.DC.Scripts.Bindings, line 1, in ? Module Shared.DC.Scripts.Bindings, line 291, in _getTraverseSubpath AttributeError: 'str' object has no attribute 'other' From rocky at serverzen.com Thu Dec 7 13:49:02 2006 From: rocky at serverzen.com (Rocky Burt) Date: Thu, 07 Dec 2006 09:19:02 -0330 Subject: [z3-five] MailHosts as utilities In-Reply-To: <4577E35D.6030805@simplistix.co.uk> References: <4577E35D.6030805@simplistix.co.uk> Message-ID: <1165495739.18712.33.camel@localhost> On Thu, 2006-07-12 at 09:48 +0000, Chris Withers wrote: > Anyone done any work on writing an interface for MailHost-like things > and then getting MailHost, MaildropHost, SecureMailHost and friends to > implement the interface and be registered as local utilities? Our plan in the plone world has been to create a local utility version of IMailer provided by zope.app.mail (it only provides a global utility so far). We would install this on a per-plone instance. Of course we would then write our own MailHost stub to provide plone BBB. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061207/62b24468/attachment.pgp From maciej.wisniowski at coig.katowice.pl Thu Dec 7 14:03:37 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Thu, 07 Dec 2006 14:03:37 +0100 Subject: [z3-five] Widget Error on direct __call__ with pt In-Reply-To: <457801F9.7070105@gmx.net> References: <457801F9.7070105@gmx.net> Message-ID: <45781129.2030504@coig.katowice.pl> > def __call__(self): > class TemplateObjectWidgetView(ObjectWidgetView): > template = ZopeTwoPageTemplateFile("itemwidget.pt") > template = TemplateObjectWidgetView(self, self.request) > return template() Maybe try with: return template.__of__(self)() -- Maciej Wisniowski From d.schulz81 at gmx.net Thu Dec 7 15:50:47 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Thu, 07 Dec 2006 15:50:47 +0100 Subject: [z3-five] Sequence Widget Error on direct __call__ with pt In-Reply-To: <45781129.2030504@coig.katowice.pl> References: <457801F9.7070105@gmx.net> <45781129.2030504@coig.katowice.pl> Message-ID: <45782A47.5070907@gmx.net> Maciej Wisniowski escribi?: >> def __call__(self): >> class TemplateObjectWidgetView(ObjectWidgetView): >> template = ZopeTwoPageTemplateFile("itemwidget.pt") >> template = TemplateObjectWidgetView(self, self.request) >> return template() >> > Maybe try with: > return template.__of__(self)() No, have been trying a lot, but I could not get it to work until now. This aquisition context drives me mad. _getTraverseSubpath is trying to access the request object, but gets always as string. similar problem here: http://comments.gmane.org/gmane.comp.web.zope.z3base.five/1682 I think that this is a ZopeTwoPageTemplateFile - ViewPageTemplateFile compatibility issue. I am using CustomWidgetFactory to initialize: item_widget = CustomWidgetFactory(objectwidget.RecordWidget, Item) items_widget = CustomWidgetFactory(objectwidget.TableRecordSequenceWidget, subwidget=item_widget) But is noone out there who managed to integrate a Sequence Widget with proper page template into plone 2.5? It is really so strange when I don't use any page template for the widget and write html in the __call__ method it works. Dennis From d.schulz81 at gmx.net Thu Dec 7 18:34:30 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Thu, 07 Dec 2006 18:34:30 +0100 Subject: [z3-five] formlib yes or no Message-ID: <457850A6.6050201@gmx.net> Hello I am currently in a decision making process to build an application. (actually already over it) In the last weeks and even months I made experiences with formlib and I am questioning if it makes sense to carry on with formlib or design everything from the ground up manually in own page templates. The most scary thing is that there is very few documentation and almost no examples of bigger applications using it. Is anybody else using formlib/ widgets/ objectwidgets? This is my first bigger application in which I try to use it, but I am getting into more and more issues and thinking of swiching to handmade forms again. Maybe when it gets too special and there has to be customized to much in comparision to the autogenerated form it is not worth dealing with all the problems you get. Here a list of problems I currently have that are at least closly related to formlib: - there is no update of no-value on select fields (choice). normally you should also be able to choose nothing when the field is required=False - Standard AddFormbase is only for input widgets. I made an alternative version that also allows passing the value through displayWidgets like in the editForm. Here I had the strange problem, that one particular value was sometimes not included when for_display=True, but maybe also my own fault. - What is the best place to set fields with default values? Sometimes I need to get these values with GET. overwrite setupWidgets and set the get_rendered attribute of the fields? - various action buttons that allow a different application of the entered values. How only validating a certain part of the form? - cancel button without any validation? In my form every click on cancel also performs a validation even if I don't explicitly call applychanges. Why? - more control over validation. how can I validate and save only two fields of a form, not the whole list? Dennis From regebro at gmail.com Thu Dec 7 18:49:30 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu, 7 Dec 2006 18:49:30 +0100 Subject: [z3-five] formlib yes or no In-Reply-To: <457850A6.6050201@gmx.net> References: <457850A6.6050201@gmx.net> Message-ID: <319e029f0612070949s470c42ect598d4728289c3b7c@mail.gmail.com> On 12/7/06, Dennis Schulz wrote: > I am currently in a decision making process to build an application. > (actually already over it) > In the last weeks and even months I made experiences with formlib and I > am questioning if it makes sense to carry on with formlib or design > everything from the ground up manually in own page templates. > The most scary thing is that there is very few documentation and almost > no examples of bigger applications using it. > Is anybody else using formlib/ widgets/ objectwidgets? > This is my first bigger application in which I try to use it, but I am > getting into more and more issues and thinking of swiching to handmade > forms again. > Maybe when it gets too special and there has to be customized to much in > comparision to the autogenerated form it is not worth dealing with all > the problems you get. I haven't used formlib, but I have used the schema forms extensively, and I have to admit that that choice was a mistake in the context of Zope2. Formlib is better, though, but I don't know how much. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/ From zope-mailinglist at mopa.at Thu Dec 7 19:27:18 2006 From: zope-mailinglist at mopa.at (Bernd Dorn) Date: Thu, 7 Dec 2006 19:27:18 +0100 Subject: [z3-five] formlib yes or no In-Reply-To: <457850A6.6050201@gmx.net> References: <457850A6.6050201@gmx.net> Message-ID: On 07.12.2006, at 18:34, Dennis Schulz wrote: > Hello > > I am currently in a decision making process to build an application. > (actually already over it) > In the last weeks and even months I made experiences with formlib > and I > am questioning if it makes sense to carry on with formlib or design > everything from the ground up manually in own page templates. > The most scary thing is that there is very few documentation and > almost > no examples of bigger applications using it. you may take a look at zope/app/formlib/form.txt imho you should always use formlib the object widget stuff is a widget issue, sometimes its faster to write your own custom widget for objects From rocky at serverzen.com Thu Dec 7 19:28:42 2006 From: rocky at serverzen.com (Rocky Burt) Date: Thu, 07 Dec 2006 14:58:42 -0330 Subject: [z3-five] formlib yes or no In-Reply-To: <319e029f0612070949s470c42ect598d4728289c3b7c@mail.gmail.com> References: <457850A6.6050201@gmx.net> <319e029f0612070949s470c42ect598d4728289c3b7c@mail.gmail.com> Message-ID: <1165516118.31317.8.camel@localhost> On Thu, 2006-07-12 at 18:49 +0100, Lennart Regebro wrote: > On 12/7/06, Dennis Schulz wrote: > > I am currently in a decision making process to build an application. > > (actually already over it) > > In the last weeks and even months I made experiences with formlib and I > > am questioning if it makes sense to carry on with formlib or design > > everything from the ground up manually in own page templates. > > The most scary thing is that there is very few documentation and almost > > no examples of bigger applications using it. > > Is anybody else using formlib/ widgets/ objectwidgets? > > This is my first bigger application in which I try to use it, but I am > > getting into more and more issues and thinking of swiching to handmade > > forms again. > > Maybe when it gets too special and there has to be customized to much in > > comparision to the autogenerated form it is not worth dealing with all > > the problems you get. > > I haven't used formlib, but I have used the schema forms extensively, > and I have to admit that that choice was a mistake in the context of > Zope2. Formlib is better, though, but I don't know how much. Just curious, how was that choice a mistake in the context of Zope2 ? - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061207/dcf9306c/attachment.pgp From rocky at serverzen.com Thu Dec 7 19:30:50 2006 From: rocky at serverzen.com (Rocky Burt) Date: Thu, 07 Dec 2006 15:00:50 -0330 Subject: [z3-five] formlib yes or no In-Reply-To: <457850A6.6050201@gmx.net> References: <457850A6.6050201@gmx.net> Message-ID: <1165516246.31317.12.camel@localhost> On Thu, 2006-07-12 at 18:34 +0100, Dennis Schulz wrote: > The most scary thing is that there is very few documentation and almost > no examples of bigger applications using it. Formlib is a relatively new technology for those of us in the Zope 2 field. You're right, documentation is sparse. But this is quickly changing as people write docs and blog about their experiences (from within a Zope 2 context). The first formal documentation to cover formlib (don't recall how advanced techniques are demonstrated just now) is probably in the just released second edition of Philipp von Weitershausen's zope 3 book. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061207/7dcd0b5d/attachment.pgp From regebro at gmail.com Thu Dec 7 20:26:09 2006 From: regebro at gmail.com (Lennart Regebro) Date: Thu, 7 Dec 2006 20:26:09 +0100 Subject: [z3-five] formlib yes or no In-Reply-To: <1165516118.31317.8.camel@localhost> References: <457850A6.6050201@gmx.net> <319e029f0612070949s470c42ect598d4728289c3b7c@mail.gmail.com> <1165516118.31317.8.camel@localhost> Message-ID: <319e029f0612071126m34640d94hd7b4ab53ad49ac55@mail.gmail.com> On 12/7/06, Rocky Burt wrote: > Just curious, how was that choice a mistake in the context of Zope2 ? It's been a LOT of work to get it functioning, and there are serious amounts of magic in CalZope to handle this, and making new widgets it very complex. All in all, I probably have more code supporting the forms and widgets than I would have had in supporting plain html-forms. From k_vertigo at objectrealms.net Thu Dec 7 20:27:18 2006 From: k_vertigo at objectrealms.net (Kapil Thangavelu) Date: Thu, 07 Dec 2006 14:27:18 -0500 Subject: [z3-five] formlib yes or no In-Reply-To: <457850A6.6050201@gmx.net> References: <457850A6.6050201@gmx.net> Message-ID: On Thu, 07 Dec 2006 12:34:30 -0500, Dennis Schulz wrote: > Hello > > I am currently in a decision making process to build an application. > (actually already over it) > In the last weeks and even months I made experiences with formlib and I > am questioning if it makes sense to carry on with formlib or design > everything from the ground up manually in own page templates. > The most scary thing is that there is very few documentation and almost > no examples of bigger applications using it. > Is anybody else using formlib/ widgets/ objectwidgets? > This is my first bigger application in which I try to use it, but I am > getting into more and more issues and thinking of swiching to handmade > forms again. > Maybe when it gets too special and there has to be customized to much in > comparision to the autogenerated form it is not worth dealing with all > the problems you get. > i've been using formlib extensively the last few months, it definitely has a few warts as regards z2, but just most of the issues can be solved with a custom subclass or custom widget. what formlib gives in turn offers enough benefits that i tend to think its a huge win over manually dealing with form validation/actions and is fairly generic as a policy framework for attaching validation/failure/success handlers to, but i agree, that its at times convoluted. and there is a strong sense when using that widget framework hasn't been used in 'anger' in z2, thats distinct from formlib though. > Here a list of problems I currently have that are at least closly > related to formlib: > > - there is no update of no-value on select fields (choice). normally you > should also be able to choose nothing when the field is required=False probably easiest to just register a custom select field widget, that has a blank option whhere warranted. > - Standard AddFormbase is only for input widgets. I made an alternative > version that also allows passing the value through displayWidgets like > in the editForm. > Here I had the strange problem, that one particular value was sometimes > not included when for_display=True, but maybe also my own fault. > dunno. > - What is the best place to set fields with default values? Sometimes I > need to get these values with GET. overwrite setupWidgets and set the > get_rendered attribute of the fields? > formlib sometimes needs some help here, you can either initialize the object context with field defaults prior to display, manually constructing formfield iterating over schema.getFields( iface ) to pass to a fields container with get_rendered set (get_rendered = lambda form, field=field, field.default), or subclass form and reimplement setupWidgets, i had to custom patch it to get this, afaicr... > - various action buttons that allow a different application of the > entered values. How only validating a certain part of the form? you can set a different validator on a given action, which can implement validation however you want. > > - cancel button without any validation? In my form every click on cancel > also performs a validation even if I don't explicitly call applychanges. > Why? hmm.. this is sort of lame.. i agree, the formbase.validate always gets called.. form.formbase.update->form.handleSubmit->(no custom validator on action)->default validator->formbase.validate you can define a return true validator on your cancel action to avoid, or override update. > > - more control over validation. how can I validate and save only two > fields of a form, not the whole list? custom validator on action, custom success handler on action. hth, kapil From d.schulz81 at gmx.net Fri Dec 8 15:08:33 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 08 Dec 2006 15:08:33 +0100 Subject: [z3-five] formlib yes or no In-Reply-To: References: <457850A6.6050201@gmx.net> Message-ID: <457971E1.1060104@gmx.net> Thank you very much once more, Kapil, that is already a big help to me ;-) If anyone knows examples of a bigger (enterprise?) applications please post. I looked at various ones like schooltool, infrae library etc, and they already help, sometimes of course they lack zope 2 / five integration. Dennis Kapil Thangavelu escribi?: > On Thu, 07 Dec 2006 12:34:30 -0500, Dennis Schulz > wrote: > > >> Hello >> >> I am currently in a decision making process to build an application. >> (actually already over it) >> In the last weeks and even months I made experiences with formlib and I >> am questioning if it makes sense to carry on with formlib or design >> everything from the ground up manually in own page templates. >> The most scary thing is that there is very few documentation and almost >> no examples of bigger applications using it. >> Is anybody else using formlib/ widgets/ objectwidgets? >> This is my first bigger application in which I try to use it, but I am >> getting into more and more issues and thinking of swiching to handmade >> forms again. >> Maybe when it gets too special and there has to be customized to much in >> comparision to the autogenerated form it is not worth dealing with all >> the problems you get. >> >> > > i've been using formlib extensively the last few months, it definitely has > a few warts as regards z2, but just most of the issues can be solved with > a custom subclass or custom widget. what formlib gives in turn offers > enough benefits that i tend to think its a huge win over manually dealing > with form validation/actions and is fairly generic as a policy framework > for attaching validation/failure/success handlers to, but i agree, that > its at times convoluted. and there is a strong sense when using that > widget framework hasn't been used in 'anger' in z2, thats distinct from > formlib though. > > >> Here a list of problems I currently have that are at least closly >> related to formlib: >> >> - there is no update of no-value on select fields (choice). normally you >> should also be able to choose nothing when the field is required=False >> > > probably easiest to just register a custom select field widget, that has a > blank option whhere warranted. > > >> - Standard AddFormbase is only for input widgets. I made an alternative >> version that also allows passing the value through displayWidgets like >> in the editForm. >> Here I had the strange problem, that one particular value was sometimes >> not included when for_display=True, but maybe also my own fault. >> >> > > dunno. > > >> - What is the best place to set fields with default values? Sometimes I >> need to get these values with GET. overwrite setupWidgets and set the >> get_rendered attribute of the fields? >> >> > > formlib sometimes needs some help here, you can either initialize the > object context with field defaults prior to display, manually constructing > formfield iterating over schema.getFields( iface ) to pass to a fields > container with get_rendered set (get_rendered = lambda form, field=field, > field.default), or subclass form and reimplement setupWidgets, i had to > custom patch it to get this, afaicr... > > > >> - various action buttons that allow a different application of the >> entered values. How only validating a certain part of the form? >> > > you can set a different validator on a given action, which can implement > validation however you want. > > > >> - cancel button without any validation? In my form every click on cancel >> also performs a validation even if I don't explicitly call applychanges. >> Why? >> > > > hmm.. this is sort of lame.. i agree, the formbase.validate always gets > called.. > > form.formbase.update->form.handleSubmit->(no custom validator on > action)->default validator->formbase.validate > > you can define a return true validator on your cancel action to avoid, or > override update. > > > >> - more control over validation. how can I validate and save only two >> fields of a form, not the whole list? >> > > > custom validator on action, custom success handler on action. > > > hth, > > kapil > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > > > From r.ritz at biologie.hu-berlin.de Fri Dec 8 16:15:04 2006 From: r.ritz at biologie.hu-berlin.de (Raphael Ritz) Date: Fri, 08 Dec 2006 16:15:04 +0100 Subject: [z3-five] formlib yes or no In-Reply-To: <457971E1.1060104@gmx.net> References: <457850A6.6050201@gmx.net> <457971E1.1060104@gmx.net> Message-ID: Dennis Schulz schrieb: > Thank you very much once more, Kapil, that is already a big help to me ;-) > > If anyone knows examples of a bigger (enterprise?) applications please post. > I looked at various ones like schooltool, infrae library etc, and they > already help, sometimes of course they lack zope 2 / five integration. > Have you seen how Plone currently supports formlib? http://dev.plone.org/plone/browser/plone.app.form/trunk/plone/app/form Raphael From d.schulz81 at gmx.net Fri Dec 8 19:31:30 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 08 Dec 2006 19:31:30 +0100 Subject: [z3-five] sequence widget with proper pt Message-ID: <4579AF82.40404@gmx.net> hello me again :-) I am still trying to run my sequencewidget with proper .pt file. There are no problems running the sequencewidget without overwritting the call method (just use the standard implementation) or overwrite __call__ and putting the html manually in the __call__ like in ListSequenceWidget. However, it would be so nice to have a page template instead that is called. I found various examples that worked like this, for example in fb.fields, but I just can't get it run...... (Here once more my setup: Plone 2.5.1, Zope 2.9.5, Five 1.4.2) Here is what I tried: from Products.Five.form.objectwidget import ObjectWidgetClass, ObjectWidgetView from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile class TableRecordSequenceWidgetView(ObjectWidgetView): template = ZopeTwoPageTemplateFile('www/dennistest.pt') class TableRecordSequenceWidget(ListSequenceWidget): def __init__(self, context, field, request, template_='', subwidget=None): super(TableRecordSequenceWidget, self).__init__(context, field, request, subwidget) self.view = TableRecordSequenceWidgetView(self, request) def __call__(self): --1-- return self.view() Error Type AttributeError Error Value 'str' object has no attribute 'other' _getTraverseSubpath is trying to access the request object, but gets always as string. similar problem here: http://comments.gmane.org/gmane.comp.web.zope.z3base.five/1682 ----> detailled traceback see mail from yesterday --2-- return self.view.__of__(self)() Error Type AttributeError Error Value TableRecordSequenceWidgetView instance has no attribute '__of__' --3-- return self.view().__of__(self.context) Error Type AttributeError Error Value 'str' object has no attribute 'other' ................. I just know that the error is probably due to a compability issue between ViewPageTemplateFile - ZopeTwoPageTemplateFile because all the examples I have seen are using viewpagetemplatefile and obviously seem to work. But I am lacking enough background understanding of Zope 2 / Zope 3 / Aquisition to find out how to solve this. Maybe you can help me. It really would change my situation. Thanks, Dennis From d.schulz81 at gmx.net Fri Dec 8 21:46:39 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 08 Dec 2006 21:46:39 +0100 Subject: [z3-five] PT has no attribute 'getPhysicalRoot' Message-ID: <4579CF2F.7090507@gmx.net> ok have to admit that the error I posted 2 hours ago was due to an import of the ObjectWidgetView of zope.app.form that I forgot.............but still not works.. i am close to desparation .........my problem is apparently, that I try to include a Zope 2 Page Template on a component that expects a Zope 3 Page Template. the Error: "Attribute Error: 'TableRecordSequenceWidget' object has no attribute 'getPhysicalRoot' " refers to this part of the five pagetemplatefile.py: def _pt_getContext(self): try: root = self.getPhysicalRoot() except AttributeError: ------>root = self.context.getPhysicalRoot() <----------------------- # Even if the context isn't a view (when would that be exaclty?), # there shouldn't be any dange in applying a view, because it # won't be used. However assuming that a lack of getPhysicalRoot # implies a missing view causes problems. view = self._getContext() here = self.context.aq_inner so first we look after the root of the view -> there is none then we look after the root of the TableRecordSequenceWidget -> there is also none why the template has no aquisition context? maybe the guys who did the integration work in five could explain this? source: from Products.Five.form.objectwidget import ObjectWidgetClass, ObjectWidgetView from zope.app.form.browser import ListSequenceWidget class TableRecordSequenceWidgetView(ObjectWidgetView): template = ZopeTwoPageTemplateFile('www/dennistest.pt') class TableRecordSequenceWidget(ListSequenceWidget): def __init__(self, context, field, request, template_='', subwidget=None): super(TableRecordSequenceWidget, self).__init__( context, field, request, subwidget) self.view = TableRecordSequenceWidgetView(self, request) def __call__(self): return self.view() traceback: Traceback (innermost last): Module ZPublisher.Publish, line 115, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 41, in call_object Module zope.formlib.form, line 898, in __call__ Module zope.formlib.form, line 892, in render Module Shared.DC.Scripts.Bindings, line 311, in __call__ Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 113, in _exec Module Products.PageTemplates.PageTemplate, line 104, in pt_render - Module TAL.TALInterpreter, line 238, in __call__ Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 749, in do_useMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 749, in do_useMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 780, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 457, in do_optTag_tal Module TAL.TALInterpreter, line 442, in do_optTag Module TAL.TALInterpreter, line 437, in no_tag Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 728, in do_defineMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 772, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 728, in do_defineMacro Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 780, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 772, in do_defineSlot Module TAL.TALInterpreter, line 281, in interpret Module TAL.TALInterpreter, line 647, in do_insertStructure_tal Module Products.PageTemplates.TALES, line 221, in evaluate - URL: data_edit - Line 154, Column 5 - Expression: standard:'widget' - Names: {'container': , 'context': , 'default': , 'here': , 'loop': , 'modules': , 'nothing': None, 'options': {'args': ()}, 'repeat': , 'request': , 'root': , 'template': , 'traverse_subpath': [], 'user': , 'view': , 'views': } Module Products.PageTemplates.Expressions, line 185, in __call__ Module Products.PageTemplates.Expressions, line 180, in _eval Module Products.PageTemplates.Expressions, line 85, in render Module Products.PurchaseRequisition.browser.objectwidget, line 388, in __call__ Module zope.app.form.browser.objectwidget, line 41, in __call__ Module Shared.DC.Scripts.Bindings, line 311, in __call__ Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec Module Products.PageTemplates.PageTemplateFile, line 113, in _exec Module Products.PageTemplates.PageTemplate, line 98, in pt_render - Module Products.Five.browser.pagetemplatefile, line 68, in _pt_getContext AttributeError: 'TableRecordSequenceWidget' object has no attribute 'getPhysicalRoot' Also I already tried: return self.view.__of__(self)() with the following error: TypeError: attempt to wrap extension method using an object that is not an extension class instance. From d.schulz81 at gmx.net Fri Dec 8 22:11:50 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 08 Dec 2006 22:11:50 +0100 Subject: [z3-five] PT has no attribute 'getPhysicalRoot' In-Reply-To: References: <4579CF2F.7090507@gmx.net> Message-ID: <4579D516.6040000@gmx.net> That could be possible. Now I tried to give the view the context of the Sequence Widget with the following result Is this the prove? source: class TableRecordSequenceWidgetView(ObjectWidgetView): template = ZopeTwoPageTemplateFile('www/dennistest.pt') class TableRecordSequenceWidget(ListSequenceWidget): def __init__(self, context, field, request, template_='', subwidget=None): super(TableRecordSequenceWidget, self).__init__( context, field, request, subwidget) self.view = TableRecordSequenceWidgetView(self, request).__of__(context) def __call__(self): return self.view() Traceback (innermost last): Module ZPublisher.Publish, line 115, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 41, in call_object Module zope.formlib.form, line 897, in __call__ Module Products.PurchaseRequisition.browser.CELLSformlib, line 254, in update Module Products.Five.formlib.formbase, line 54, in update Module zope.formlib.form, line 860, in update Module Products.PurchaseRequisition.browser.purchaseRequisition, line 127, in setUpWidgets Module zope.formlib.form, line 930, in setUpWidgets Module zope.formlib.form, line 513, in setUpEditWidgets Module zope.formlib.form, line 442, in _createWidget Module zope.app.form, line 120, in __call__ Module zope.app.form, line 102, in _create Module Products.PurchaseRequisition.browser.objectwidget, line 385, in __init__ TypeError: attempt to wrap extension method using an object that is not an extension class instance. Kapil Thangavelu escribi?: > i wonder if some of these issues aren't coming from the fact that your > getting mapped objects from the database without acquisition wrapping > them? > > -kapil > > On Fri, 08 Dec 2006 15:46:39 -0500, Dennis Schulz > wrote: > >> ok have to admit that the error I posted 2 hours ago was due to an >> import of the ObjectWidgetView of zope.app.form that I >> forgot.............but still not works.. i am close to desparation >> .........my problem is apparently, that I try to include a Zope 2 Page >> Template on a component that expects a Zope 3 Page Template. >> >> the Error: >> "Attribute Error: 'TableRecordSequenceWidget' object has no attribute >> 'getPhysicalRoot' " >> refers to this part of the five pagetemplatefile.py: >> >> def _pt_getContext(self): >> try: >> root = self.getPhysicalRoot() >> except AttributeError: >> ------>root = self.context.getPhysicalRoot() <----------------------- >> # Even if the context isn't a view (when would that be >> exaclty?), >> # there shouldn't be any dange in applying a view, because it >> # won't be used. However assuming that a lack of >> getPhysicalRoot >> # implies a missing view causes problems. >> view = self._getContext() >> >> here = self.context.aq_inner >> >> >> so first we look after the root of the view -> there is none >> then we look after the root of the TableRecordSequenceWidget -> there >> is also none >> >> why the template has no aquisition context? >> >> maybe the guys who did the integration work in five could explain this? >> >> source: >> >> from Products.Five.form.objectwidget import ObjectWidgetClass, >> ObjectWidgetView >> from zope.app.form.browser import ListSequenceWidget >> >> >> class TableRecordSequenceWidgetView(ObjectWidgetView): >> template = ZopeTwoPageTemplateFile('www/dennistest.pt') >> >> class TableRecordSequenceWidget(ListSequenceWidget): >> def __init__(self, context, field, request, template_='', >> subwidget=None): >> super(TableRecordSequenceWidget, self).__init__( >> context, field, request, subwidget) >> self.view = TableRecordSequenceWidgetView(self, request) >> def __call__(self): >> return self.view() >> >> traceback: >> >> Traceback (innermost last): >> Module ZPublisher.Publish, line 115, in publish >> Module ZPublisher.mapply, line 88, in mapply >> Module ZPublisher.Publish, line 41, in call_object >> Module zope.formlib.form, line 898, in __call__ >> Module zope.formlib.form, line 892, in render >> Module Shared.DC.Scripts.Bindings, line 311, in __call__ >> Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec >> Module Products.PageTemplates.PageTemplateFile, line 113, in _exec >> Module Products.PageTemplates.PageTemplate, line 104, in pt_render >> - >> Module TAL.TALInterpreter, line 238, in __call__ >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 749, in do_useMacro >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 457, in do_optTag_tal >> Module TAL.TALInterpreter, line 442, in do_optTag >> Module TAL.TALInterpreter, line 437, in no_tag >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 749, in do_useMacro >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 457, in do_optTag_tal >> Module TAL.TALInterpreter, line 442, in do_optTag >> Module TAL.TALInterpreter, line 437, in no_tag >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 780, in do_defineSlot >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 457, in do_optTag_tal >> Module TAL.TALInterpreter, line 442, in do_optTag >> Module TAL.TALInterpreter, line 437, in no_tag >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 728, in do_defineMacro >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 772, in do_defineSlot >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 728, in do_defineMacro >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 780, in do_defineSlot >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 772, in do_defineSlot >> Module TAL.TALInterpreter, line 281, in interpret >> Module TAL.TALInterpreter, line 647, in do_insertStructure_tal >> Module Products.PageTemplates.TALES, line 221, in evaluate >> - URL: data_edit >> - Line 154, Column 5 >> - Expression: standard:'widget' >> - Names: >> {'container': > /Plone/purchaserequisition.2006-11-29.6153287929/pr/202>, >> 'context': > /Plone/purchaserequisition.2006-11-29.6153287929/pr/202>, >> 'default': > 0x017E85A8>, >> 'here': > /Plone/purchaserequisition.2006-11-29.6153287929/pr/202>, >> 'loop': > 0x06161788>, >> 'modules': >> > 0x017D5AF8>, >> 'nothing': None, >> 'options': {'args': ()}, >> 'repeat': > 0x06161788>, >> 'request': > URL=http://localhost:8080/Plone/purchaserequisition.2006-11-29.6153287929/pr/202/predit>, >> >> 'root': , >> 'template': , >> 'traverse_subpath': [], >> 'user': , >> 'view': > 0x061A19D0>, >> 'views': > object at 0x06170250>} >> Module Products.PageTemplates.Expressions, line 185, in __call__ >> Module Products.PageTemplates.Expressions, line 180, in _eval >> Module Products.PageTemplates.Expressions, line 85, in render >> Module Products.PurchaseRequisition.browser.objectwidget, line 388, in >> __call__ >> Module zope.app.form.browser.objectwidget, line 41, in __call__ >> Module Shared.DC.Scripts.Bindings, line 311, in __call__ >> Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec >> Module Products.PageTemplates.PageTemplateFile, line 113, in _exec >> Module Products.PageTemplates.PageTemplate, line 98, in pt_render >> - >> Module Products.Five.browser.pagetemplatefile, line 68, in >> _pt_getContext >> AttributeError: 'TableRecordSequenceWidget' object has no attribute >> 'getPhysicalRoot' >> >> >> Also I already tried: >> return self.view.__of__(self)() >> >> with the following error: >> TypeError: attempt to wrap extension method using an object that >> is not an extension class instance. >> >> >> >> >> >> _______________________________________________ >> z3-five mailing list >> z3-five at codespeak.net >> http://codespeak.net/mailman/listinfo/z3-five > > > From d.schulz81 at gmx.net Fri Dec 8 23:14:50 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Fri, 08 Dec 2006 23:14:50 +0100 Subject: [z3-five] PT has no attribute 'getPhysicalRoot' In-Reply-To: <4579D516.6040000@gmx.net> References: <4579CF2F.7090507@gmx.net> <4579D516.6040000@gmx.net> Message-ID: <4579E3DA.9050706@gmx.net> I am really sorry for all this questions on this list today.........................but it is still not running.......... I tried to subclass the DomainClass in alchemist from Acquisition.Explicit (and tried also Implicit) but still the same error messages like before. When I print out context.aq_chain then says that 'List' object has no attribute 'aq_chain'. So its useless in this case to get the aquisition context like that. But, Kapil, are you really sure that this can be the reason? Like I wrote in the mails before, when I remove my __call__ method, everything immediately works fine with the default __call__ of SequenceWidget, but without page template. Now I really dont know what else I could try in this direction. Maybe I have to wait until someone does the integration for Plone. Dennis Dennis Schulz escribi?: > That could be possible. Now I tried to give the view the context of the > Sequence Widget with the following result > Is this the prove? > > source: > class TableRecordSequenceWidgetView(ObjectWidgetView): > template = ZopeTwoPageTemplateFile('www/dennistest.pt') > > class TableRecordSequenceWidget(ListSequenceWidget): > def __init__(self, context, field, request, template_='', > subwidget=None): > super(TableRecordSequenceWidget, self).__init__( > context, field, request, subwidget) > self.view = TableRecordSequenceWidgetView(self, > request).__of__(context) > def __call__(self): > return self.view() > > Traceback (innermost last): > Module ZPublisher.Publish, line 115, in publish > Module ZPublisher.mapply, line 88, in mapply > Module ZPublisher.Publish, line 41, in call_object > Module zope.formlib.form, line 897, in __call__ > Module Products.PurchaseRequisition.browser.CELLSformlib, line 254, in > update > Module Products.Five.formlib.formbase, line 54, in update > Module zope.formlib.form, line 860, in update > Module Products.PurchaseRequisition.browser.purchaseRequisition, line > 127, in setUpWidgets > Module zope.formlib.form, line 930, in setUpWidgets > Module zope.formlib.form, line 513, in setUpEditWidgets > Module zope.formlib.form, line 442, in _createWidget > Module zope.app.form, line 120, in __call__ > Module zope.app.form, line 102, in _create > Module Products.PurchaseRequisition.browser.objectwidget, line 385, in > __init__ > TypeError: attempt to wrap extension method using an object that is not > an extension class instance. > > > > > > > Kapil Thangavelu escribi?: > >> i wonder if some of these issues aren't coming from the fact that your >> getting mapped objects from the database without acquisition wrapping >> them? >> >> -kapil >> >> On Fri, 08 Dec 2006 15:46:39 -0500, Dennis Schulz >> wrote: >> >> >>> ok have to admit that the error I posted 2 hours ago was due to an >>> import of the ObjectWidgetView of zope.app.form that I >>> forgot.............but still not works.. i am close to desparation >>> .........my problem is apparently, that I try to include a Zope 2 Page >>> Template on a component that expects a Zope 3 Page Template. >>> >>> the Error: >>> "Attribute Error: 'TableRecordSequenceWidget' object has no attribute >>> 'getPhysicalRoot' " >>> refers to this part of the five pagetemplatefile.py: >>> >>> def _pt_getContext(self): >>> try: >>> root = self.getPhysicalRoot() >>> except AttributeError: >>> ------>root = self.context.getPhysicalRoot() <----------------------- >>> # Even if the context isn't a view (when would that be >>> exaclty?), >>> # there shouldn't be any dange in applying a view, because it >>> # won't be used. However assuming that a lack of >>> getPhysicalRoot >>> # implies a missing view causes problems. >>> view = self._getContext() >>> >>> here = self.context.aq_inner >>> >>> >>> so first we look after the root of the view -> there is none >>> then we look after the root of the TableRecordSequenceWidget -> there >>> is also none >>> >>> why the template has no aquisition context? >>> >>> maybe the guys who did the integration work in five could explain this? >>> >>> source: >>> >>> from Products.Five.form.objectwidget import ObjectWidgetClass, >>> ObjectWidgetView >>> from zope.app.form.browser import ListSequenceWidget >>> >>> >>> class TableRecordSequenceWidgetView(ObjectWidgetView): >>> template = ZopeTwoPageTemplateFile('www/dennistest.pt') >>> >>> class TableRecordSequenceWidget(ListSequenceWidget): >>> def __init__(self, context, field, request, template_='', >>> subwidget=None): >>> super(TableRecordSequenceWidget, self).__init__( >>> context, field, request, subwidget) >>> self.view = TableRecordSequenceWidgetView(self, request) >>> def __call__(self): >>> return self.view() >>> >>> traceback: >>> >>> Traceback (innermost last): >>> Module ZPublisher.Publish, line 115, in publish >>> Module ZPublisher.mapply, line 88, in mapply >>> Module ZPublisher.Publish, line 41, in call_object >>> Module zope.formlib.form, line 898, in __call__ >>> Module zope.formlib.form, line 892, in render >>> Module Shared.DC.Scripts.Bindings, line 311, in __call__ >>> Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec >>> Module Products.PageTemplates.PageTemplateFile, line 113, in _exec >>> Module Products.PageTemplates.PageTemplate, line 104, in pt_render >>> - >>> Module TAL.TALInterpreter, line 238, in __call__ >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 749, in do_useMacro >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 457, in do_optTag_tal >>> Module TAL.TALInterpreter, line 442, in do_optTag >>> Module TAL.TALInterpreter, line 437, in no_tag >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 749, in do_useMacro >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 457, in do_optTag_tal >>> Module TAL.TALInterpreter, line 442, in do_optTag >>> Module TAL.TALInterpreter, line 437, in no_tag >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 780, in do_defineSlot >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 457, in do_optTag_tal >>> Module TAL.TALInterpreter, line 442, in do_optTag >>> Module TAL.TALInterpreter, line 437, in no_tag >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 728, in do_defineMacro >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 772, in do_defineSlot >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 728, in do_defineMacro >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 780, in do_defineSlot >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 772, in do_defineSlot >>> Module TAL.TALInterpreter, line 281, in interpret >>> Module TAL.TALInterpreter, line 647, in do_insertStructure_tal >>> Module Products.PageTemplates.TALES, line 221, in evaluate >>> - URL: data_edit >>> - Line 154, Column 5 >>> - Expression: standard:'widget' >>> - Names: >>> {'container': >> /Plone/purchaserequisition.2006-11-29.6153287929/pr/202>, >>> 'context': >> /Plone/purchaserequisition.2006-11-29.6153287929/pr/202>, >>> 'default': >> 0x017E85A8>, >>> 'here': >> /Plone/purchaserequisition.2006-11-29.6153287929/pr/202>, >>> 'loop': >> 0x06161788>, >>> 'modules': >>> >> 0x017D5AF8>, >>> 'nothing': None, >>> 'options': {'args': ()}, >>> 'repeat': >> 0x06161788>, >>> 'request': >> URL=http://localhost:8080/Plone/purchaserequisition.2006-11-29.6153287929/pr/202/predit>, >>> >>> 'root': , >>> 'template': , >>> 'traverse_subpath': [], >>> 'user': , >>> 'view': >> 0x061A19D0>, >>> 'views': >> object at 0x06170250>} >>> Module Products.PageTemplates.Expressions, line 185, in __call__ >>> Module Products.PageTemplates.Expressions, line 180, in _eval >>> Module Products.PageTemplates.Expressions, line 85, in render >>> Module Products.PurchaseRequisition.browser.objectwidget, line 388, in >>> __call__ >>> Module zope.app.form.browser.objectwidget, line 41, in __call__ >>> Module Shared.DC.Scripts.Bindings, line 311, in __call__ >>> Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec >>> Module Products.PageTemplates.PageTemplateFile, line 113, in _exec >>> Module Products.PageTemplates.PageTemplate, line 98, in pt_render >>> - >>> Module Products.Five.browser.pagetemplatefile, line 68, in >>> _pt_getContext >>> AttributeError: 'TableRecordSequenceWidget' object has no attribute >>> 'getPhysicalRoot' >>> >>> >>> Also I already tried: >>> return self.view.__of__(self)() >>> >>> with the following error: >>> TypeError: attempt to wrap extension method using an object that >>> is not an extension class instance. >>> >>> >>> >>> >>> >>> _______________________________________________ >>> z3-five mailing list >>> z3-five at codespeak.net >>> http://codespeak.net/mailman/listinfo/z3-five >>> >> >> > > > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > From optilude at gmx.net Sat Dec 9 00:11:45 2006 From: optilude at gmx.net (Martin Aspeli) Date: Fri, 08 Dec 2006 23:11:45 +0000 Subject: [z3-five] PT has no attribute 'getPhysicalRoot' In-Reply-To: <4579E3DA.9050706@gmx.net> References: <4579CF2F.7090507@gmx.net> <4579D516.6040000@gmx.net> <4579E3DA.9050706@gmx.net> Message-ID: Dennis Schulz wrote: > I tried to subclass the DomainClass in alchemist from > Acquisition.Explicit (and tried also Implicit) but still the same error > messages like before. > When I print out context.aq_chain then says that 'List' object has no > attribute 'aq_chain'. So its useless in this case to get the aquisition > context like that. I'm struggling to follow your reports here, but just some general notes on Acquisition and Five: Anything you publish in Zope 2 really needs an acquisition wrapper. A lack of such often manifests itself in odd security errors (like username not found, or simply Unauthorized). Acquisition.Explicit will normally do. Views generally need this - and this is what you get with Products.Five.browser.BrowserView as a base class. Sometimes, things expect to be able to acquire things implicitly. In that case, Acquisition.Implicit is a better base class, but I try to avoid it. I've found in a few cases that I need to inherit from OFS.SimpleItem.SimpleItem for things to work; this normally means that the code is expecting to be a pretty fully-featured Zope 2 object (e.g. it has a role manager). To be honest, this is like shooting pigeons with cannons, but it's sometimes a useful thing to try, if just to see whether you are missing some mix-in class. If you have a browser view that mixes in Acquisition (as you nearly always need to) then you may run into strange acquisition chain problems. Normally, it goes like this: from Products.Five.browser import BrowserView class MyView(BrowserView): def __init__(self, context, request): self.context = context self.request = request def my_function(self): # do something with self.context Since you assigned context to self.context, and context is most likely a Zope 2 object, then context has an inner acquisition chain based on containment (aq_parent(context) is the parent object of the context object in the containment hierarchy). However, the outermost acquistion chain involves the MyView class, because it has Acquisition.Explicit and anything you retrieve from it by attribute access gets wrapped in that object. So, aq_chain(self.context) will be something like MyContext - MyView - aq_parent(MyView) ...; in most cases this is not what you really expect. It normally works fine, until you do something with context that expects a sane acquisition chain. Sometimes you can also get nested acquisition chains, which is really nasty. The most common solution is to always use aq_inner(self.context). I tend do start most of my functions with: from Acquisition import aq_inner def my_function(self): context = aq_inner(self.context) # do something with context, not self.context Another pattern, which you see in Plone (and which I dislike, but it's a bit safer) is to do this: def __init__(self, context, request): self._context = [context] self.context = context # you normally need this anyway self.request = request def my_function(self): context = self._context[0] Since self._context is a list, the items in that list are not acquisition wrapped, so you're safe. Anyway, I hope that helps a bit. It's normally quite instructive to print aq_chain(context) in a debug session and see whether it looks sane (normally, it should reflect containment and end with BaseRequest). Martin From d.schulz81 at gmx.net Sat Dec 9 15:04:37 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Sat, 09 Dec 2006 15:04:37 +0100 Subject: [z3-five] PT has no attribute 'getPhysicalRoot' In-Reply-To: References: <4579CF2F.7090507@gmx.net> <4579D516.6040000@gmx.net> <4579E3DA.9050706@gmx.net> Message-ID: <457AC275.4040007@gmx.net> Thanks Martin for the comments on acquisition. I experienced a lot with debugging this morning and hopefully learned a lot. Finally the solution was that not the domainrecord was lacking aquisition, but of course the pure Zope 3 sequencewidget was not inside the aquisition tree. So in the end it was quite simple, you had to do it like in the modified ObjectWidget of Five: mix in acquisition and put it into a wrapper. So the lesson I learned is whenever you want to use a page template on a widget you have to wrap it into acquisition. Now I finally can do the project :-) , cheers Dennis :-) Martin Aspeli escribi?: > Dennis Schulz wrote: > >> I tried to subclass the DomainClass in alchemist from >> Acquisition.Explicit (and tried also Implicit) but still the same error >> messages like before. >> >> When I print out context.aq_chain then says that 'List' object has no >> attribute 'aq_chain'. So its useless in this case to get the aquisition >> context like that. >> > > > I'm struggling to follow your reports here, but just some general notes > on Acquisition and Five: > > Anything you publish in Zope 2 really needs an acquisition wrapper. A > lack of such often manifests itself in odd security errors (like > username not found, or simply Unauthorized). Acquisition.Explicit will > normally do. Views generally need this - and this is what you get with > Products.Five.browser.BrowserView as a base class. > > Sometimes, things expect to be able to acquire things implicitly. In > that case, Acquisition.Implicit is a better base class, but I try to > avoid it. > > I've found in a few cases that I need to inherit from > OFS.SimpleItem.SimpleItem for things to work; this normally means that > the code is expecting to be a pretty fully-featured Zope 2 object (e.g. > it has a role manager). To be honest, this is like shooting pigeons with > cannons, but it's sometimes a useful thing to try, if just to see > whether you are missing some mix-in class. > > If you have a browser view that mixes in Acquisition (as you nearly > always need to) then you may run into strange acquisition chain > problems. Normally, it goes like this: > > >from Products.Five.browser import BrowserView > class MyView(BrowserView): > > def __init__(self, context, request): > self.context = context > self.request = request > > def my_function(self): > # do something with self.context > > Since you assigned context to self.context, and context is most likely a > Zope 2 object, then context has an inner acquisition chain based on > containment (aq_parent(context) is the parent object of the context > object in the containment hierarchy). However, the outermost acquistion > chain involves the MyView class, because it has Acquisition.Explicit and > anything you retrieve from it by attribute access gets wrapped in that > object. > > So, aq_chain(self.context) will be something like MyContext - MyView - > aq_parent(MyView) ...; in most cases this is not what you really expect. > It normally works fine, until you do something with context that expects > a sane acquisition chain. Sometimes you can also get nested acquisition > chains, which is really nasty. > > The most common solution is to always use aq_inner(self.context). I tend > do start most of my functions with: > > >from Acquisition import aq_inner > > def my_function(self): > context = aq_inner(self.context) > # do something with context, not self.context > > Another pattern, which you see in Plone (and which I dislike, but it's a > bit safer) is to do this: > > def __init__(self, context, request): > self._context = [context] > self.context = context # you normally need this anyway > self.request = request > > def my_function(self): > context = self._context[0] > > Since self._context is a list, the items in that list are not > acquisition wrapped, so you're safe. > > Anyway, I hope that helps a bit. It's normally quite instructive to > print aq_chain(context) in a debug session and see whether it looks sane > (normally, it should reflect containment and end with BaseRequest). > > Martin > > _______________________________________________ > z3-five mailing list > z3-five at codespeak.net > http://codespeak.net/mailman/listinfo/z3-five > > > From chris at simplistix.co.uk Mon Dec 11 16:54:50 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Mon, 11 Dec 2006 15:54:50 +0000 Subject: [z3-five] MailHosts as utilities In-Reply-To: <319e029f0612070320y5e6e84c0ye466d68acfb0b5d0@mail.gmail.com> References: <4577E35D.6030805@simplistix.co.uk> <319e029f0612070320y5e6e84c0ye466d68acfb0b5d0@mail.gmail.com> Message-ID: <457D7F4A.8070902@simplistix.co.uk> Lennart Regebro wrote: > On 12/7/06, Chris Withers wrote: >> Anyone done any work on writing an interface for MailHost-like things >> and then getting MailHost, MaildropHost, SecureMailHost and friends to >> implement the interface and be registered as local utilities? > > I think Zope3 actually may have some stuff like that. CPSMailAccess > uses it, I think. I'm more talking about retrofitting existing ones so that we can do away with the superValues nonsense... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From sebastien.vinot at logisphere.fr Tue Dec 12 19:07:03 2006 From: sebastien.vinot at logisphere.fr (=?ISO-8859-1?Q?S=E9bastien_VINOT?=) Date: Tue, 12 Dec 2006 19:07:03 +0100 Subject: [z3-five] "view" variable on a view Message-ID: <457EEFC7.4090409@logisphere.fr> Hello, I'm using Five (version 1.3.6) with Plone 2.5 and Zope 2.9.4 under a Debian release. I have a View (defined on my configuration.zcml file) which works perfectly. I've seen on Zope3 "Web Component Dev with Zope 3" that a variable called "view" can be used (aspecially if both a template and a class are specified on the "browser:page") inside Views. When I try to a a simple "" mon my view, I get an exception error : Not authorized to access binding: context I also tried to call method of my view class. My question is : can we use the "view" variable inside a Five view ? Thanks Sebastien From maciej.wisniowski at coig.katowice.pl Tue Dec 12 19:27:58 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Tue, 12 Dec 2006 19:27:58 +0100 Subject: [z3-five] "view" variable on a view In-Reply-To: <457EEFC7.4090409@logisphere.fr> References: <457EEFC7.4090409@logisphere.fr> Message-ID: <457EF4AE.1080205@coig.katowice.pl> > I've seen on Zope3 "Web Component Dev with Zope 3" that a > variable called "view" can be used (aspecially if both a template and a > class are specified on the "browser:page") inside Views. Have you seen: http://plone.org/documentation/tutorial/five-zope3-walkthrough ? Maybe it will be helpful. -- Maciej Wisniowski From optilude at gmx.net Tue Dec 12 20:09:47 2006 From: optilude at gmx.net (Martin Aspeli) Date: Tue, 12 Dec 2006 19:09:47 +0000 Subject: [z3-five] "view" variable on a view In-Reply-To: <457EEFC7.4090409@logisphere.fr> References: <457EEFC7.4090409@logisphere.fr> Message-ID: S?bastien VINOT wrote: > Hello, > > I'm using Five (version 1.3.6) with Plone 2.5 and Zope 2.9.4 under a > Debian release. > > I have a View (defined on my configuration.zcml file) which works > perfectly. I've seen on Zope3 "Web Component Dev with Zope 3" that a > variable called "view" can be used (aspecially if both a template and a > class are specified on the "browser:page") inside Views. > > When I try to a a simple "" mon my view, I > get an exception error : Not authorized to access binding: context > > I also tried to call method of my view class. > > My question is : can we use the "view" variable inside a Five view ? Yes. Take a look at http://plone.org/documentation/tutorial/borg/zope-3-views Your security problems are most likely caused by a lack of acquisition in the view. Inheriting from Products.Five.browser.BrowserView tends to work the best. Martin From sidnei at enfoldsystems.com Thu Dec 21 02:47:19 2006 From: sidnei at enfoldsystems.com (Sidnei da Silva) Date: Wed, 20 Dec 2006 23:47:19 -0200 Subject: [z3-five] BasicAdding vs. The Acquisition Monster Message-ID: Is anyone using the BasicAdding view with Zope 2 objects? It twists the acquisition chain in such a way that I doubt it is useful for anyone. I'm considering replacing it with my own Acquisition-safe view for my projects, but wonder if anyone else is interested in such a beast. -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 From d.schulz81 at gmx.net Thu Dec 21 16:12:02 2006 From: d.schulz81 at gmx.net (Dennis Schulz) Date: Thu, 21 Dec 2006 16:12:02 +0100 Subject: [z3-five] 3 step selection widget Message-ID: <458AA442.8020101@gmx.net> hello, I have the current use case to write a 3 step-selection widget. The user has to choose 1. Division, 2. Cost Center and 3. Budget (which is the actual choice) So I need 3 different vocabularies that change according to the current context. It would be nice to have a onChange event. Anyone has done something similar before? Thanks, Dennis From optilude at gmx.net Wed Dec 27 18:11:54 2006 From: optilude at gmx.net (Martin Aspeli) Date: Wed, 27 Dec 2006 18:11:54 +0100 Subject: [z3-five] Using vocabularies for Choice fields where the vocabulary is acquired Message-ID: Hi, I want to use a vocabulary in a zope.schema.Choice field in a formlib form. From Philipp's book, I see how to hook a vocabulary up to a form, but this either uses hard coded simple items or the utility registry (a utility vocabulary). I need to present a list of portal types, acquired by traversing to the portal_types tool and asking it for a list of type ids (or id/name combinations, probably). To do so, however, I need a context so that I can acquire the portal_types tool. Both a module-level vocabulary and a utility vocabulary suffers from being context-less. However, at least at the time when the form is rendered I will have a context. Can anyone point me to some code or documentation that shows how to wait until run-time to define the vocabulary, and gives me the current context from which to do so? Thanks, Martin From plone at hannosch.info Wed Dec 27 20:48:41 2006 From: plone at hannosch.info (Hanno Schlichting) Date: Wed, 27 Dec 2006 20:48:41 +0100 Subject: [z3-five] Using vocabularies for Choice fields where the vocabulary is acquired In-Reply-To: References: Message-ID: <4592CE19.7000202@hannosch.info> Hi Martin, Martin Aspeli wrote: > Hi, > > I want to use a vocabulary in a zope.schema.Choice field in a formlib > form. From Philipp's book, I see how to hook a vocabulary up to a form, > but this either uses hard coded simple items or the utility registry (a > utility vocabulary). > > I need to present a list of portal types, acquired by traversing to the > portal_types tool and asking it for a list of type ids (or id/name > combinations, probably). > > To do so, however, I need a context so that I can acquire the > portal_types tool. Both a module-level vocabulary and a utility > vocabulary suffers from being context-less. However, at least at the > time when the form is rendered I will have a context. I'm not sure that my approach is by any means good or advisable but you could take a look at the PortalTypesVocabulary in plone.app.controlpanel.vocabularies and its usage on the search control panel defined by the ISearchSchema in search.py in the same package. The code can be found at http://dev.plone.org/plone/browser/plone.app.controlpanel/trunk/plone/app/controlpanel > Can anyone point me to some code or documentation that shows how to wait > until run-time to define the vocabulary, and gives me the current > context from which to do so? Maybe you can even just use the vocabulary I've already written in which case we might need to move it to a more general package. Hanno From optilude at gmx.net Wed Dec 27 22:14:53 2006 From: optilude at gmx.net (Martin Aspeli) Date: Wed, 27 Dec 2006 22:14:53 +0100 Subject: [z3-five] Using vocabularies for Choice fields where the vocabulary is acquired In-Reply-To: <4592CE19.7000202@hannosch.info> References: <4592CE19.7000202@hannosch.info> Message-ID: Hanno Schlichting wrote: > I'm not sure that my approach is by any means good or advisable but you > could take a look at the PortalTypesVocabulary in > plone.app.controlpanel.vocabularies and its usage on the search control > panel defined by the ISearchSchema in search.py in the same package. > > The code can be found at > http://dev.plone.org/plone/browser/plone.app.controlpanel/trunk/plone/app/controlpanel > >> Can anyone point me to some code or documentation that shows how to wait >> until run-time to define the vocabulary, and gives me the current >> context from which to do so? > > Maybe you can even just use the vocabulary I've already written in which > case we might need to move it to a more general package. Ah, excellent Hanno. :) I can use this just by name, I guess. Having a package (plone.app.vocabularies?) with common vocabularies (portal type, workflow states, roles, groups, users...) may make sense. I'm adding roles and groups to plone.app.contentrules.vocabularies, if you're up for the task of consolidating (I don't have time right now). Martin From optilude at gmx.net Wed Dec 27 22:33:20 2006 From: optilude at gmx.net (Martin Aspeli) Date: Wed, 27 Dec 2006 22:33:20 +0100 Subject: [z3-five] Using vocabularies for Choice fields where the vocabulary is acquired In-Reply-To: References: <4592CE19.7000202@hannosch.info> Message-ID: Martin Aspeli wrote: > Hanno Schlichting wrote: > >> I'm not sure that my approach is by any means good or advisable but you >> could take a look at the PortalTypesVocabulary in >> plone.app.controlpanel.vocabularies and its usage on the search control >> panel defined by the ISearchSchema in search.py in the same package. >> >> The code can be found at >> http://dev.plone.org/plone/browser/plone.app.controlpanel/trunk/plone/app/controlpanel >> >>> Can anyone point me to some code or documentation that shows how to wait >>> until run-time to define the vocabulary, and gives me the current >>> context from which to do so? >> Maybe you can even just use the vocabulary I've already written in which >> case we might need to move it to a more general package. > > Ah, excellent Hanno. :) > > I can use this just by name, I guess. Having a package > (plone.app.vocabularies?) with common vocabularies (portal type, > workflow states, roles, groups, users...) may make sense. > > I'm adding roles and groups to plone.app.contentrules.vocabularies, if > you're up for the task of consolidating (I don't have time right now). btw, considering the namespace is global (utility names) I suggest we use a dotted name, like plone.vocabulary.PortalType or what not. Martin From rocky at serverzen.com Thu Dec 28 13:45:24 2006 From: rocky at serverzen.com (Rocky Burt) Date: Thu, 28 Dec 2006 09:15:24 -0330 Subject: [z3-five] Using vocabularies for Choice fields where the vocabulary is acquired In-Reply-To: References: <4592CE19.7000202@hannosch.info> Message-ID: <1167309921.569.20.camel@localhost> On Wed, 2006-27-12 at 22:14 +0100, Martin Aspeli wrote: > I can use this just by name, I guess. Having a package > (plone.app.vocabularies?) with common vocabularies (portal type, > workflow states, roles, groups, users...) may make sense. +1 on this. We're going to quickly find tons of general vocabularies that are useful to the global mass. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061228/531a5873/attachment.pgp From rocky at serverzen.com Thu Dec 28 13:46:16 2006 From: rocky at serverzen.com (Rocky Burt) Date: Thu, 28 Dec 2006 09:16:16 -0330 Subject: [z3-five] Using vocabularies for Choice fields where the vocabulary is acquired In-Reply-To: References: <4592CE19.7000202@hannosch.info> Message-ID: <1167309973.569.22.camel@localhost> On Wed, 2006-27-12 at 22:33 +0100, Martin Aspeli wrote: > btw, considering the namespace is global (utility names) I suggest we > use a dotted name, like plone.vocabulary.PortalType or what not. +1 -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://codespeak.net/pipermail/z3-five/attachments/20061228/16d15d55/attachment.pgp