[Zope] external and sql methods
ainis
ainis@mindless.com
Wed, 04 Aug 1999 13:08:27 -0700
Tony McDonald wrote:
> At 11:38 am -0700 4/8/99, ainis wrote:
> >Is there any way to call sql method from external method?
> >
>
> Yes.
>
> def dopey_example(self):
> for the_item in self.your_ZSQL_method(param1=your_val,
> param2=your_val2):
> do_interesting_things_with(the_item)
>
> 'self' is your link to the Zope system (ie if you have a property
> called 'quote', then self.quote will obtain that for you).
>
Ok, and how about opening files/objects in zope folder with external
method? For example I have in the same zope folder Book1.txt file which
I have to parse and pass it to the SQL method. Do I have to supply full
path: open(/usr/local/Zope bla blabla/Book1.txt....) [I cannot do it
open('self.Book1.txt'..] or can I somehow open all files/objects in
current folder without supplying path?
And one more question- how do I make a form that allows to upload files
to some zope folder?