getting a dtmlfile from ZODB instead of the file system.
Yo, Most of the products that were developed using code instead of ZClasses. The problem i have is that the forms for management are always created on the file system, like this: index_html = DTMLFile('www/index_html', globals()) I really would like the index_html file to come from the ZODB instead of the file system, so how do I do that? I suspect opening a database object with from ZODB import FileStorage, DB storage = FileStorage.FileStorage('var/data.fs') db = DB(storage) connection = db.open() root = connection.root() and looking it up is not the ideal solution, fi I don't know what will happen with ohter threads accessing the same object aso. So How do I do that ? TIA, Sloot.
On Wed, 2002-01-23 at 15:59, Romain Slootmaekers wrote:
Yo,
Most of the products that were developed using code instead of ZClasses.
The problem i have is that the forms for management are always created on the file system, like this:
index_html = DTMLFile('www/index_html', globals())
You could simply not provide an index_html and expect the user (or your own code, using Zope API) to put one inside your object, provided your object is an ObjectManager. If it isn't, but it is acquisition enabled (eg. it extends SimpleItem or another Acquisition.Implicit descendant) you can still assume there is an index_html, which will be looked up in the acquisistion chain, and use it as such. -- Ideas don't stay in some minds very long because they don't like solitary confinement.
The problem i have is that the forms for management are always created on the file system, like this:
index_html = DTMLFile('www/index_html', globals())
I'm sure you have your reasons. But this don't seem to hurt many people, basically because it's not usual to change management forms without changing the code handling it. Best regards! -- Gustavo Niemeyer [ 2AAC 7928 0FBF 0299 5EB5 60E2 2253 B29A 6664 3A0C ]
participants (3)
-
Gustavo Niemeyer -
Leonardo Rochael Almeida -
Romain Slootmaekers