[Zope] XXXPythonScripts release 1.0

tom smith tom@othermedia.com
Wed, 22 Aug 2001 21:07:13 +0100


Can you put me straight?

I have a folder structure like this...

    Folder:Delia
        ZSQLMethod: get_categories()

        Folder:Admin
            XXXPythonScript: do_something()
            DTMLMethod:test

The XXXPythonScript, do_something tries to call get_categories like this...

dbresults = context.get_categories(item_id=4)
results = [ ]
For I in dbresults:
    results.append(i.category_id)
return results
    

But it always says it can't find get_categories. I thought it would just
look back up the tree and find it..

Alternatively, if I move do_something into the Delia folder and call it with
DTMLMethod test like this...

<dtml-in "do_something(item_id=4)">
            <dtml-var sequence-item><br>
</dtml-in>

... I get 

Error Type: NameError
Error Value: do_something

How does a Python Script call a ZSQLMethod that is higher in the hierarchy
(or maybe in the same folder)?

Thanks

Tom

-- 
tom smith | tom@othermedia.com
http://www.othermedia.com/blog