Re: [Zope3-Users] Re: Access request object from content_factory

2006-06-21 Thread Philipp von Weitershausen
Rupert Redington wrote: > The utility is responsible for generating a PDF snapshot of a view - as > seen by the invoking user at the point when the utility is invoked. To > do this I open an HTMLDOC subprocess which needs a url to go to, and > which needs to know which user to pretend to be so that

Re: [Zope3-Users] Re: Access request object from content_factory

2006-06-21 Thread Rupert Redington
Philipp von Weitershausen wrote: > > That already sounds like bad design. Why would the local utility worry > about URLs at all? > It probably is :-) The utility is responsible for generating a PDF snapshot of a view - as seen by the invoking user at the point when the utility is invoked. To d

Re: [Zope3-Users] Re: Access request object from content_factory

2006-06-21 Thread Philipp von Weitershausen
Rupert Redington wrote: >> The hack displayed above (going thru the security interaction) should >> not be considered a standard procedure for getting at the request in >> places where you don't have it. Content objects are dull. They do >> nothing. Other stuff does things *to* them. Mats' solution

Re: [Zope3-Users] Re: Access request object from content_factory

2006-06-21 Thread Benji York
Rupert Redington wrote: John Smith wrote: No zapi? How did I miss that? Where do I get my utilities, parents, roots, adapters from now? I think the right answer to that is "wherever zapi got them from in the first place" Well said. -- Benji York Senior Software Engineer Zope Corporation

Re: [Zope3-Users] Re: Access request object from content_factory

2006-06-21 Thread Rupert Redington
John Smith wrote: > --- Rupert Redington <[EMAIL PROTECTED]> wrote: > >> I realise that I shouldn't use zapi anymore... apart > > > Good gracious! > > No zapi? > > How did I miss that? Where do I get my utilities, > parents, roots, adapters from now? > > John. > > (dazed and confused) >

Re: [Zope3-Users] Re: Access request object from content_factory

2006-06-21 Thread John Smith
--- Rupert Redington <[EMAIL PROTECTED]> wrote: > I realise that I shouldn't use zapi anymore... apart Good gracious! No zapi? How did I miss that? Where do I get my utilities, parents, roots, adapters from now? John. (dazed and confused) ___

Re: [Zope3-Users] Re: Access request object from content_factory

2006-06-21 Thread John Smith
Well, I always like to do things the way the experts recommend :) Are there any suggestions for this use case?: I have a content class, which consists of 2 attributes: 1. a user comment 2. the name of the logged in user So far, I have been using the browser:addform directive to add instances,

Re: [Zope3-Users] Re: Access request object from content_factory

2006-06-21 Thread Rupert Redington
Philipp von Weitershausen wrote: > Marco Mariani wrote: >> Rupert Redington wrote: >>> from zope.security.management import getInteraction >>> >>> request = getInteraction().participations[0] >>> >>> Why this works is outlined (IIRC) in zope/app/securitypolicy/zopepolicy.txt. >>> >>> There may well

[Zope3-Users] Re: Access request object from content_factory

2006-06-21 Thread Philipp von Weitershausen
Marco Mariani wrote: > Rupert Redington wrote: >> from zope.security.management import getInteraction >> >> request = getInteraction().participations[0] >> >> Why this works is outlined (IIRC) in zope/app/securitypolicy/zopepolicy.txt. >> >> There may well be better ways to fish for the request tha