[Zope] Preventing download of Document object
Simon Blandford
home@simonb.org.uk
Sat, 06 Oct 2001 16:47:05 +0000
Hey everybody I have finally fixed it!
It is one of those things that is so simple I wonder what I've been
doing with my life the last few weeks I've been working on this.
All I had to do was declare...
def index_html(self):
return
...in the Document class. Now it is possible to access the methods of
the document but not the document directly. This fix is a bit dirty
because I would really like to return a polite error message instead of the
"Missing docstring at: http://blah.blah.blah/index_html" error I get at
the moment. But that is not so important.
I also added
manage_FTPget=index_html
at the end of the class definition to prevent access that way.
Regards,
Simon B.
Stefan H. Holek wrote:
>GuardedFile might help, or at least looking at its code might ;-)
>http://www.pobox.org.sg/home/ngps/zope/gf/
>
>Stefan
>
>
>On Mon, 1 Oct 2001, Simon Blandford wrote:
>
>>Create a Product within a product?
>>
>>This is a snippet of the code to create the document...
>> def addDocumentFile(self, REQUEST):
>> """Adds a new document and sets its properties from a form based
>>submission"""
>>
>> self=self.this()
>> doc = Document.Document(title=REQUEST.title, container=self)
>> self._setObject(doc.getId(), doc)
>> doc = self._getOb(doc.getId())
>>
>>What I need is for the new Document object to not be viewable by default.
>>
>
>