[Zope] feed ZSQL "select" to a multiple selection property

Dustin Mitchell dustin at ywlcs.org
Mon Sep 1 19:07:49 EDT 2003


Use an SQL query as below, then call it from a Python script, located
within acquisition context, such as

---
rv = []
for row in old_zsql_method:
  rv.append(row.field1)
return rv
---

Then give the name of your Python script as the default value of the
"multiple" property.

Dustin

On Mon, Sep 01, 2003 at 06:06:32PM -0500, Daniel Ajoy wrote:
> Thanks but what I need is the opposite. I what the result of
> this:
> 
> select field1 from table order by field1
> 
> be the posible values of a property of type "multiple selection" of
> an object.
> 
> Daniel
> 
> 
> 
> On 1 Sep 2003 at 13:30, David Hassalevris wrote:
> 
> > Daniel,
> > Here is a snippet from some old zsql method.
> > --------------- 
> > code --------------------------------------------------------
> > select segment3,segment4, description from COA_DETAIL
> > where postflag = 1 and base_acct_type_id = 4
> > and <dtml-sqltest accounts column="segment3" type="string" op="eq" multiple>
> > order by segment3,segment4
> > 
> > Notes:
> >    . accounts is a list.  In the parameters section I used accounts:list.
> >   . I could not get this to work using zSql TEST.  Try it from a method.
> >  ---------------------------------------------------------------------------
> > -----
> > David
> > 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 

-- 

  Dustin Mitchell
  dustin at ywlcs.org/djmitche at alumni.uchicago.edu
  http://people.cs.uchicago.edu/~dustin/
  PGP Key: http://people.cs.uchicago.edu/~dustin/pubkey.txt



More information about the Zope mailing list