[Zope-Perl] ZSQL from Perl

Andy McKay andym@ActiveState.com
Mon, 2 Apr 2001 13:53:26 -0700


You cant access an object the same way you do in python. You have to use
Python::getitem. Eg:

my $sql = Python::getitem($self, 'sql');
my $Lst = Python::getitem($sql, 'Lst');
$Lst->SubmitStat etc...

This is covered in my Powerpoint pres at:
http://www.zope.org/Members/andym/wiki/ReSources

Cheers.
--
  Andy McKay.


----- Original Message -----
From: "Ulrich Wisser" <u.wisser@publisher.de>
To: <zope-perl@zope.org>
Sent: Monday, April 02, 2001 12:51 AM
Subject: [Zope-Perl] ZSQL from Perl


> Hello,
>
> how can I access ZSQL methods from my Perl (unrestricted) scripts?
>
> In dtml I do this:
>
> <dtml-in "sql.Lst.Submitstat(site=website,dat=datum)">
>
> In Perl I tried:
>
> foreach $row ($self->{sql}->{Lst}->Submitstat("site" =>
> $self->{REQUEST}->website, "dat" => $self->{REQUEST}->datum)) {
>
> but I get an error message:
>
> Error Type: KeyError
> Error Value: sql
>
> with this traceback:
>
> Traceback (innermost last):
>    File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/Publish.py,
> line 222, in publish_module
>    File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/Publish.py,
> line 187, in publish
>    File /usr/local/Zope-2.2.5-linux2-x86/lib/python/Zope/__init__.py, line
> 221, in zpublisher_exception_hook
>      (Object: Traversable)
>    File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/Publish.py,
> line 171, in publish
>    File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/mapply.py,
> line 160, in mapply
>      (Object: excel_dok)
>    File /usr/local/Zope-2.2.5-linux2-x86/lib/python/ZPublisher/Publish.py,
> line 112, in call_object
>      (Object: excel_dok)
>    File
>
/usr/local/Zope-2.2.5-linux2-x86/lib/python/Products/PerlExternalMethod/__in
it__.py,
> line 119, in __call__
>      (Object: excel_dok)
>    File /usr/local/Zope-2.2.5-linux2-x86/lib/python/OFS/ObjectManager.py,
> line 627, in __getitem__
>      (Object: Traversable)
> KeyError: (see above)
>
> Any ideas?
>
> Thanks
>
> Ulrich
> --
> Searchengine Know How  - Webpromotion - Optimization - Internal Search
> World Wide Web Publisher, Ulrich Wisser, Odensvag 13, S-14571 Norsborg
> http://www.publisher.de   Tel: +46-8-53460905    Fax: +46-8-534 609 06
>
>
> _______________________________________________
> Zope-perl maillist  -  Zope-perl@zope.org
> http://lists.zope.org/mailman/listinfo/zope-perl
>