Re: [Zope3-Users] Access to request in content object and object path in doctests

2007-01-26 Thread David Johnson
I do lots of database stuff, like what you're describing. I got lost in the threads here, but my general advice is the following: 1. Do not mix content with views, this destroys the scalability aspects of Zope and will hurt you later. When ever you find Zope frustrating it often because

Re: [Zope3-Users] Access to request in content object and object path in doctests

2007-01-26 Thread Maciej Wisniowski
2. Generally you will want to create content with methods that can perform the database operations you would like. For example, I recently created a Container/Folder that contains object from a database. The container is persistent. The container however loads the content from an SQL

Re: [Zope3-Users] Access to request in content object and object path in doctests

2007-01-25 Thread Maciej Wisniowski
InterfaceClass zope.traversing.interfaces.IPhysicallyLocatable) Ehm...? Ideas? OK, I forgot about: setup.setUpTraversal() Now it works with: from zope.app.folder import rootFolder from zope.traversing.api import getPath root = rootFolder() root['test_content'] = DBCrudContent()

Re: [Zope3-Users] Access to request in content object and object path in doctests

2007-01-25 Thread Maciej Wisniowski
line 154, in getPath raise TypeError(Not enough context to determine location root) TypeError: Not enough context to determine location root I've added Contained as the base class of my content and it works now... uff... -- Maciej Wisniowski

Re: [Zope3-Users] Access to request in content object and object path in doctests

2007-01-24 Thread Marius Gedminas
On Wed, Jan 24, 2007 at 11:50:21PM +0100, Maciej Wisniowski wrote: Is this possible to get request object in content class. In Zope2 this was possible with simple self.REQUEST. In Zope3 I tried self.request but I only get errors. Maybe this is a feature, and I'm not supposed to access