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-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-25 Thread Marius Gedminas
On Thu, Jan 25, 2007 at 08:44:43AM +0100, Maciej Wisniowski wrote: > > Yes. You're not supposed to do that. Views work with requests, not > > content objects. > > > > If you told us what you want to achieve, we could help you find a way to > > do it that works with Zope 3 rather than against it.

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-25 Thread Maciej Wisniowski
> ) > > 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() >>> test_content = root['test_content'] >>> getPath(root

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

2007-01-24 Thread Maciej Wisniowski
> Yes. You're not supposed to do that. Views work with requests, not > content objects. > > If you told us what you want to achieve, we could help you find a way to > do it that works with Zope 3 rather than against it. > I'am creating form (CRUD) based on formlib, but this is supposed to wor

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 r