[Zope] FQ Path Names in container

Roy Rapoport r.rapoport@fi.com
Tue Aug 5 18:41:07 EDT 2003


Goal:
  Serve 'protected' documents via a Python Script in Zope.  The concept is
that you'll actually access the script and, if it decides you're authorized,
will give you the documents.  
Problem:
  Returning a document that's in the same directory as the script is a
no-brainer -- return container['docname'] works perfectly well.  Returning a
document that is in a relative directory is also not a problem -- Assuming
this directory structure:
/
  A
    B
      C.pdf (1)
  D
    A
      B
        C.pdf (2)
    C.pdf (3)
    script

Then if we're accessing /D/script and returning 'container['C.pdf']' we'll
return C.pdf(3); if we return 'container['A/B/C.pdf'] then we'll return
C.pdf(2) (acquisition is a beautiful thing).

However, returning 'container['A/B/C.pdf'] gives me a key error.  This makes
it rather difficult to access C.pdf(1).

I have two possibilities:
A) Figure out how to use fully qualified paths in my return statement; 
B) Do something interesting with acquisition and URLs -- something like
calling /A/B/D/script, having script figure out its context is actually
/A/B, and then return the C.pdf in that directory.  Unfortunately, reading
both the Zope book and the Zope Web Application Development and Content
Management book did not reveal to me how I'd go about doing it, and my
random stumbling around and attempts to get this done have not worked
successfully.

Suggestions?

-roy
Content-Type: text/plain;
	charset="iso-8859-1"
 




-------------------------------------------------
PLEASE READ THIS WARNING: All e-mail sent to or from this address will be
received or otherwise recorded by the Fisher Investments  corporate e-mail
system and is  subject to archival, monitoring or review by, and/or
disclosure to, someone other than the recipient.





More information about the Zope mailing list