> 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
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
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.
> 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
__
> )
>
> 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
> 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
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
Hi
Two questions...
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 request object from content class?
Another question. I'm