Re: [Zope3-Users] Name chooser and Renaming
Okay. Since I didn't get a response I assumed no one else knew either. I figured out the following: 1. Since I have a custom container that is derived from IContainer, it is already configured as a IContainerNamesContainer, and if I override chooseName() and checkName(), I get the desired effect of choosing my own names. 2. I did not adapt my container to IContainerNamesContainer, and so Rename is now enabled. This I do not understand, but it works. 3. I put a custom template in the browser:addform directive. The template was a copy of the zope.app.form.browser.add template, but I edited out the Object Name field. I have the desired effect. All seems to work very well. On Jan 8, 2007, at 6:24 PM, David Johnson wrote: Is it possible to have both a NameChooser and an ObjectRenamer. If so...how? It seems that zope.app.container.browser contents.py has the following code: self.supportsRename = ( self.supportsCut and not IContainerNamesContainer.providedBy(self.context) ) So if you have a name chooser then you cannot rename. I would like users to be able to choose the name of object (within certain basic restrictions which is why I want the name chooser), and then be able to rename the object within the same conditions. Thoughts? -- David ___ 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
[Zope3-Users] Reminder: Early Bird Registration for PyCon Ending Soon
Greetings. As the co-chair for the upcoming Python conference, being held in Dallas (Addison) Texas, I want to remind folk to register before early bird registration prices end. The event is the fifth international Python Conference, being held Feb 23-25, 2007 at the Marriott-Quorum in Addison Texas, with early-bird registration ending **Jan 15**. The conference draws approximately 400-500 attendees from diverse backgrounds such as scientists from national and medical labs, college/K-12 educators, web engineers and the myriad of IT developers and programming hobbyists. Those new to the Python language are welcome, and we're offering a half-day Python 101 tutorial on the day before the conference, Thursday Feb 22 to help you get up to speed and better enjoy the rest of the conference. We have a great selection of talks this year, some of which that are relevant to Zope are: - Web Frameworks Panel - Introduction to Zope 3 - The Component Architecture - Panel: State of Zope - WSGI: An Introduction - Using Python Eggs - Distributing your project with Python Eggs - Half-Day Tutorial: zc.buildout and the Zope Component Architecture - Half-Day Tutorial: How to Document a Python Open Source Project Being run by the Python community as a non-profit event, the conference strives to be inexpensive, with registration being only $260 (or $195 if you register prior to Jan 15th), with a further discount for students. On the day before the conference we are running a full day of classroom tutorials (extra charge per class) and then after the conference is a free four-days of sprints, which are informal gatherings of programmers to work together in coding on various projects. Sprints are excellent opportunities to do agile pair-programming side-by-side with experienced programmers and make new friends. Other activities are lightning talks, which are 5-minute presentations to show off a cool technology or spread the word about a project, open space talks, which are spontaneous gatherings around a topic and, new this year, a Python Lab where experienced and novice programmers will work together to solve challenging problems and then present their solutions. The conference is also running four keynote talks by leaders in the programming field, with a special focus on education this year: The Power of Dangerous Ideas: Python and One Laptop per Child by Ivan Krstic, senior member of the One Laptop per Child project Premise: eLearning does not Belong in Public Schools by Adele Goldberg, of SmallTalk fame Python 3000 by Guido van Rossum, creator of Python The Importance of Programming Literacy by Robert M. r0ml Lefkowitz, a frequent speaker at O'Reilly conferences I believe you will find the conference educational and enjoyable. More information about the conference along with the full schedule of presentations with abstracts, is available online: http://us.pycon.org/ Thanks for any help you can give in spreading the word, Jeff Rush Co-Chair PyCon 2007 ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: Can I use IPython in debugzope stuff ?
KLEIN Stéphane wrote: Can I use IPython in debugzope stuff ? http://wiki.zope.org/zope2/DebuggingWithIPythonAndOtherTips Should work on Zope 3 as well. -- http://worldcookery.com -- Professional Zope documentation and training 2nd edition of Web Component Development with Zope 3 is now shipping! ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Name chooser and Renaming
On Mon, Jan 08, 2007 at 06:24:17PM +0100, David Johnson wrote: Is it possible to have both a NameChooser and an ObjectRenamer. If so...how? It seems that zope.app.container.browser contents.py has the following code: self.supportsRename = ( self.supportsCut and not IContainerNamesContainer.providedBy(self.context) ) So if you have a name chooser then you cannot rename. All containers use name choosers. Some containers use a name chooser to select a default name, but let the user override it. Other containers always use a name chooser and never let you specify your own name. IContainerNamesContainer indicates that you have a container of the second kind. I hope this clears things up for you. Marius Gedminas -- My opinions may have changed, but not the fact that I'm right! signature.asc Description: Digital signature ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] getUtilitiesFor without context
Hello, I have some local utilites registered. Now I try to call them from a function that don't have a context: utils = getUtilitiesFor(INewsfeed) for i in utils: print Utility called:, i.__name__ i.sendNotification() but that always deliver no utilities. How do get them without supplying a context. (the function is called regularly from a scheduler object, therefore it needs to be static) Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] getUtilitiesFor without context
Florian Lindner wrote: Hello, I have some local utilites registered. Now I try to call them from a function that don't have a context: utils = getUtilitiesFor(INewsfeed) for i in utils: print Utility called:, i.__name__ i.sendNotification() but that always deliver no utilities. How do get them without supplying a context. (the function is called regularly from a scheduler object, therefore it needs to be static) I'm not sure what a 'scheduler object' is, but it sounds like you don't have you don't have a current site. You can confirm this with: from zope.app.component import hooks print hooks.getSite() # None Use: # work out what your site hook.set(site) before your util lookups. regards, -Tom ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] getUtilitiesFor without context
Am Mittwoch, 10. Januar 2007 22:14 schrieb Tom Dossis: Florian Lindner wrote: Hello, I have some local utilites registered. Now I try to call them from a function that don't have a context: utils = getUtilitiesFor(INewsfeed) for i in utils: print Utility called:, i.__name__ i.sendNotification() but that always deliver no utilities. How do get them without supplying a context. (the function is called regularly from a scheduler object, therefore it needs to be static) I'm not sure what a 'scheduler object' is, It's in the zope3 trunk. but it sounds like you don't have you don't have a current site. You can confirm this with: from zope.app.component import hooks print hooks.getSite() # None That is what happens. Use: # work out what your site hook.set(site) Mhh, the hook object does not exist, hooks does not have a attribute set. What object do you refer to? before your util lookups. Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] getUtilitiesFor without context
Florian Lindner wrote: Use: # work out what your site hook.set(site) Mhh, the hook object does not exist, hooks does not have a attribute set. What object do you refer to? My apologies, should be: hooks.set(site) ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] getUtilitiesFor without context
Tom Dossis wrote: Florian Lindner wrote: Use: # work out what your site hook.set(site) Mhh, the hook object does not exist, hooks does not have a attribute set. What object do you refer to? My apologies, should be: hooks.set(site) hooks.setSite(site) ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: getUtilitiesFor without context
Florian Lindner wrote: Hello, I have some local utilites registered. Now I try to call them from a function that don't have a context: utils = getUtilitiesFor(INewsfeed) for i in utils: print Utility called:, i.__name__ i.sendNotification() but that always deliver no utilities. How do get them without supplying a context. (the function is called regularly from a scheduler object, therefore it needs to be static) You need to have traversed over the site that contains the local utilities first, before they can be found. If this function is called outside a request context, use zope.app.component.hooks.setSite(site_obj) to manually set the site. -- http://worldcookery.com -- Professional Zope documentation and training 2nd edition of Web Component Development with Zope 3 is now shipping! ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] recovering from a lost db connection
What is the recommended way to recover from a db connection that is held by a Psycopgda adapter instance? If for some reason postgres goes down, I get the following error: File /var/lib/zope3/instances/instance.barry2007/lib/python/sqlos/adapter.py, line 83, in _runWithConnection val = meth(conn, *args) File /usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1814-py2.4.egg/sqlobject/dbconnection.p , line 351, in _queryOne self._executeRetry(conn, c, s) File /var/lib/zope3/instances/instance.barry2007/lib/python/sqlos/adapter.py, line 77, in _executeRetry raise DatabaseException(str(exc.args)) DatabaseException: ('no connection to the server\n',). I then have no recourse but to restart the zope server. In the Java world one would put a try/catch around the the SQL operation and attempt a reconnect, but I am wondering if there is a better way (read: automatic recovery) in a z3 world. -- Thanks, Roy Mathew. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] selling zope to a CTO
Hi all, Does anyone know of a canned presentation or slides/papers that would help convince an openminded CTO/CIO that Zope (z3) makes business sense in a world dominated by huge J2EE and .NET projects. -- Thanks, Roy Mathew. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] selling zope to a CTO
Roy Mathew a écrit : Hi all, Does anyone know of a canned presentation or slides/papers that would help convince an openminded CTO/CIO that Zope (z3) makes business sense in a world dominated by huge J2EE and .NET projects. yes :) but I guess everybody knows it http://oodt.jpl.nasa.gov/better-web-app.mov ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users