[Zope] Name Errors: DTML Document -> External Python Document -> DTML Do
cument -> ZSQL
cument -> ZSQL
Dieter Maurer
dieter@handshake.de
Fri, 22 Dec 2000 22:17:51 +0100 (CET)
"Burwell, Becky <burwell@parc.xerox.com>" <burwell@parc.xerox.com> writes:
> I have an SQL database that I want to populate using an external
> Python method (because I have file I/O code).
>
> So I have something like this:
>
> DTML Document named import_file which has:
> <dtml-call "parsefile()">
>
> ----
> parsefile is my external Python method.
>
> def parsefile (self):
> # blah, blah
> self.record_info (arg1=value1,arg2=value2)
You break the namespace chain here.
If "record_info" is indead a DTML document (and not a method!),
then you should nevertheless be able to access "LookupPrinter"
by acquisition.
I do not know, why it does not work.
You can avoid to break the namespace chain:
<dtml-call "parsefile(_)">
def parsefile(self,namespace):
self.record_info(None,namespace,arg1=value1,....)
Dieter