[Zope] Re: ImageFile weirdness? (addendum)

2006-03-02 Thread Chris Withers

Jürgen Herrmann wrote:

btw. i'll learn to formulate my questions better...

the actual question way back then should have read (and not more):
who (which method) is responsible for delivering an ImageFile instances
content when called, as index_html obviously is NOT called?


The publisher chooses what method to publish, and it usually chooses 
index_html. You did something which made the publisher not do that...


Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: ImageFile weirdness?

2006-03-02 Thread Chris Withers

Jürgen Herrmann wrote:

to not clutter the zodb-dev list, i'll write you personally...


It's what the list is here for, please keep CC'ing it or you're unlikely 
to get a response in the future...



arent't these two code snippets doing the same?

class MyClass:
  myTemplate = PageTemplateFile(...)

and:

class MyClass:
  def initTemplates(self):
myTemplate = PageTemplateFile(...)
setattr(self.__class__, 'myTemplate', myTemplate)
# calling initTemplates() once at startup.


Almost certainly not. I have no idea where 'self' in your second example 
comes from, but I'd almost bet it isn't what you expect...



i'm actually doing this since long,


That doesn't make it right ;-)


because i initialize page template
files found in a certain directory by calling initTemplates() once on
zope startup. this way i don't have to add a line for each template,
the code simply iterates over all .pt files in the directory...


Interesting, but there are likely to be problems with it. Not least of 
which: how are you adding security declarations for those new methods?



actually i have fixed my initial problem by replacing ImageFile with
ExternalFile, which behaves differently and sets the correct content-
type headers if it has a content_type property.


That doesn't sounds like such a hot idea. My understanding was that 
ExternalFile was for storing _content_ files on the filesystem...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

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

http://mail.zope.org/mailman/listinfo/zope-dev )