[Zope-dev] External method pulling data from an SQL method?

Michel Pelletier michel@digicool.com
Fri, 5 Mar 1999 10:01:54 -0500


> -----Original Message-----
> From: julian@zereau.net [mailto:julian@zereau.net]
> Sent: Friday, March 05, 1999 9:31 AM
> To: zope-dev@zope.org
> Subject: [Zope-dev] External method pulling data from an SQL method?
> 
> 
> I am using PostgreSQL's array system for a "categories" field 
> in a database, it
> return records in a format like:
> '{"foo"}'
> '{"foo","bar"}'
> '{"foo"}'
> 
> I am trying to extract the list of unique categories - in 
> this example:
> ["foo","bar"]
> 
> This would be a complete nuisance to do in DTML. I have 
> decided to read the SQL
> method's results into an external method and edit them there 
> - but first I need
> to know how to call a SQL method without the "in" DTML tag.
> 

An SQL method is like any other method.  If you want to call it from an
external method, you could try this:

<untested>

<!--#var "myExternalMethod(this())"-->

...

def myExternalMethod(self):
	self.mySQLMethod()

</untested>

This is just a sketch, but I hope you get the idea.  You don't need the
#in tag to call an SQL method, you can even call it with a #var tag, if
you don't mind the output.

-Michel

> Or maybe there is a simpler solution to all this, for any 
> PostgreSQL gurus out
> there??
> 
> ---
> Julian Morrison
> Programmer (Zereau Ltd)
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://www.zope.org/mailman/listinfo/zope-dev
>