Re: [Zope3-Users] Re: Using ZCML for defining global constants ?
On 9/11/06, Martin Aspeli [EMAIL PROTECTED] wrote: Andrew Groom wrote: Hi there, I've got a few global constants that I'd like to be available to my application and a .zcml file seems to be a sensible place. I'm thinking of something like a .zcml file with, e.g.: applicationSettings setting name=name1 value=value1/ setting name=name2 value=value2/ ... /applicationSettings This would then be available in a component as a dictionary. Is anythign like this already available ? You could just use utility, and thereby group your constants into logical chunks. interfaces.py: class IDatabaseLoginOptions(Interface): username = Attribute() password = Attribute() config.py: class DatabaseLoginOptions(object): implements(IDatabaseLoginOptions) username = 'foo' password = 'bar' configure.zcml: utility factory=.config.DatabaseLoginOptions / used: opts = getUtility(IDatabaseLoginOptions) Obviously, this is a bit more work than just declaring some constants in ZCML, but global constants suffer the same problems whether they're defined in Python or XML. Parts of your application are making assumptions that they are there, with very specific names, which are not type checked. Just added this to FAQ: http://kpug.zwiki.org/Zope3Faq Regards, Baiju M ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Using ZCML for defining global constants ?
Hi, On Mon, Sep 11, 2006 at 01:19:31PM +0530, Baiju M wrote: Just added this to FAQ: http://kpug.zwiki.org/Zope3Faq I did the same - in german: http://zope3.mpg.de/cgi-bin/twiki/view/Zope/CookBook#Globale_Konfigurationsparameter Regards, Frank ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] View:for=* and Class
Hello, Is it possible to associate a class with a skin template ? I tried to customize an example (from chap 24 Zope3) but unfortunately even if my zcml is read with no errors, the final view used is the one associated with my component. Is there a way to do this ? Sebastien. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: View:for=* and Class
Sébastien VINOT wrote: Is it possible to associate a class with a skin template ? Sure, but it won't help. I tried to customize an example (from chap 24 Zope3) but unfortunately even if my zcml is read with no errors, the final view used is the one associated with my component. Right, because when a ZPT uses a skin macro, the raw macro byte code is inserted into the the ZPT. That means all TALES variables are bound to the actual view, not the skin. Is there a way to do this ? Define a view class for * that you will query from the macro, e.g. context/@@myhelperview/foo. Philipp ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Functional Tests
Does anybody knows where i find any tutorial for zope.testbrowsers? On 9/6/06, Stephan Richter [EMAIL PROTECTED] wrote: On Tuesday 29 August 2006 16:51, David Johnson wrote: I decided it's about time to use functional tests. I've been setting them up with the following code and I get the following error (I've never gotten it to work): Two comments: 1. Use zope.testbrowser 2. You must use the Zope 3 testrunner. Hope that helps. :-) Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- Fabio Rizzo ThreePointsWeb [EMAIL PROTECTED] ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Functional Tests
Fabio Rizzo wrote: Does anybody knows where i find any tutorial for zope.testbrowsers? See the last two pages of http://plone.org/documentation/tutorial/testing. This is somewhat Plone/Five/Zope2 specific, but almost all of it should be relevant to pure Zope 3 as well. Martin -- View this message in context: http://www.nabble.com/Functional-Tests-tf2186132.html#a6245831 Sent from the Zope3 - users forum at Nabble.com. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: View:for=* and Class
Philipp von Weitershausen a écrit : Sébastien VINOT wrote: Is it possible to associate a class with a skin template ? Sure, but it won't help. Sorry but why will it not help me ? I tried to customize an example (from chap 24 Zope3) but unfortunately even if my zcml is read with no errors, the final view used is the one associated with my component. Right, because when a ZPT uses a skin macro, the raw macro byte code is inserted into the the ZPT. That means all TALES variables are bound to the actual view, not the skin. Okay, but (stop me if I'm wrong) a template can be associated to a class. I took your example 8.2.4 (chapter 8.2 Page Template macros) and thought the view class was StandardMacros. Is there a way to do this ? Define a view class for * that you will query from the macro, e.g. context/@@myhelperview/foo. Philipp I added (just for test) a function foo into your StandardMacros and added into my skin template : metal:macro use-macro=context/@@StandardMacros/foo / And I get : TypeError: unsubscriptable object (StandardMacros has your configuration). Does my understand of your suggestion wrong ? Sebastien ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Functional Tests
Fabio Rizzo Matos wrote: Does anybody knows where i find any tutorial for zope.testbrowsers? The README.txt would be a good place to start. http://svn.zope.org/Zope3/trunk/src/zope/testbrowser/README.txt?rev=69730view=markup -- Benji York Senior Software Engineer Zope Corporation ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Functional Tests
thanks Martin On 9/11/06, Martin Aspeli [EMAIL PROTECTED] wrote: Fabio Rizzo wrote: Does anybody knows where i find any tutorial for zope.testbrowsers? See the last two pages of http://plone.org/documentation/tutorial/testing. This is somewhat Plone/Five/Zope2 specific, but almost all of it should be relevant to pure Zope 3 as well. Martin -- View this message in context: http://www.nabble.com/Functional-Tests-tf2186132.html#a6245831 Sent from the Zope3 - users forum at Nabble.com. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- Fabio Rizzo ThreePointsWeb [EMAIL PROTECTED] ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Functional Tests
Thanks Benji, It's be usefull! :-) On 9/11/06, Benji York [EMAIL PROTECTED] wrote: Fabio Rizzo Matos wrote: Does anybody knows where i find any tutorial for zope.testbrowsers? The README.txt would be a good place to start. http://svn.zope.org/Zope3/trunk/src/zope/testbrowser/README.txt?rev=69730view=markup -- Benji York Senior Software Engineer Zope Corporation -- Fabio Rizzo ThreePointsWeb [EMAIL PROTECTED] ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: View:for=* and Class
Sébastien VINOT wrote: Philipp von Weitershausen a écrit : Sébastien VINOT wrote: Is it possible to associate a class with a skin template ? Sure, but it won't help. Sorry but why will it not help me ? Because the 'view' variable will be bound to the view class of the template *using* the macro, not *defining* the macro. I tried to customize an example (from chap 24 Zope3) but unfortunately even if my zcml is read with no errors, the final view used is the one associated with my component. Right, because when a ZPT uses a skin macro, the raw macro byte code is inserted into the the ZPT. That means all TALES variables are bound to the actual view, not the skin. Okay, but (stop me if I'm wrong) a template can be associated to a class. Yes, but again: when you use a macro, the macro byte code gets executed in the context of the template *using* the macro. I took your example 8.2.4 (chapter 8.2 Page Template macros) and thought the view class was StandardMacros. standardmacros is something different. It's a special view that lets us look up macros conveniently. Read that section again, it seems you've not understood standardmacros yet. Is there a way to do this ? Define a view class for * that you will query from the macro, e.g. context/@@myhelperview/foo. Philipp I added (just for test) a function foo into your StandardMacros and added into my skin template : metal:macro use-macro=context/@@StandardMacros/foo / And I get : TypeError: unsubscriptable object Please don't quote single exceptions. They're almost meaningless without a traceback. I also told you to define your own helper view. I never said anything about standardmacros. Philipp ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: zope.contentprovider and z3c.traverser
On Sunday 10 September 2006 22:29, Darryl Cousins wrote: z3c.traverser and zope.contentprovider are helpful packages with good and clear doctests. It didn't much time to get up and running with them. However the packages do not include an example of how to configure my new useful code into my project. I got it figured (well, ... it works): http://kpug.zwiki.org/Zope3Faq#configuring-z3c-traverser-and-zope-contentpr ovider Hello everyone, this is a response to several messages over the last days concerning documentation. I think what you are all doing with the online FAQs, books, recipes, etc. is just wonderful. I feel this is documentation a lot of people are longing for. And this type of documentation can only be done by people learning the framework; the experts write README's. :-) Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users