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 trying to write tests
for my content object.
Because I want some caching facilities
I'm using getLocationForCache from
zope.app.cache.caching.
and because of this: zapi.getPath(obj)

In short it is like:

class MyClass(Persistent):
    (...)
    def myfunction(self):
        location = zapi.getPath(self)
        return location

In the tests I always get location == None.
I'm using doctests like:

   >>> test_content = MyClass()
   >>> test_content.myfunction()

placefulsetup adds some objects like root etc.
but I'm not sure how I should add my object to this.
Any clues?

-- 
Maciej Wisniowski
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to