I am a bit confused about self.request and self.REQUEST.
Can anybody point me to an explanation of the different tasks that both
Googling for request vs REQUEST is not helpful...

Here is the reason why I am wondering:

Context is a small product to be used in plone.

A testcase in my code fails, and after a lot of digging, I am finding that
the reason are wrong results from the catalog. The catalog returns bad
results because he caches the results in the request.
My test consists of a number of steps, for multiple times I do a
getMultiAdapter, always with fresh TestRequests. Still it seems, that the
catalog always use some other, rotten REQUEST.

When stepping through, I see this happening:
1. my BrowserView calls something like self.context.portal_catalog(kw)
    There is no request as an argument
2. The method I call wants that as a positional argument, but has None as
the default value
    That None value gets passed on.
3. In Products.ZCatalog.Catalog:searchResults the code checks whether the
    variable is None, and if so, retrieves self.REQUEST. self.REQUEST ist
the rotten
    REQUEST, self.request would still be available
4. Total chaos is ensured

I can imagine more than one way to fix it, but I don't understand the
difference and reasoning sufficiently to decide, what would be the right(tm)
way to fix it.

Any points will be really appreciated!

Best regards,

Zope-Dev maillist  -  Zope-Dev@zope.org
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to