[Zope-DB] Selective namespace access for SQL method
Sun, 4 May 2003 22:28:20 -0700
I have a large ZSQL method (partially shown below) called buildPhraseList:
arguments = dbt, origin, protein_gene_type + 10 more
phrase_id in (
schema_table_id = 138 and database_name = 'U_DBT'
schema_table_id =138 and database_name ='U_ORIGIN'
schema_table_id =138 and database_name ='U_PROTEIN_GENE_TYPE'
order by order_number
What this is supposed to do is build a phrase list from the appropriate table,
depending on which variable was passed in. I'm using this to build components
of a form. The variables in the arguments list are coming from the results of a
previous ZSQL query, so many of the input variables are already floating in the
namespace. I have tried using
<dtml-with origin only>
<select name=foo size=1>
etc. but because dbt is in the namespace already that is the only list I can get
out. If some of the variables are missing from the namespace, then there is no
restriction and I get all values back in one list. This method works perfectly
when tested from the ZMI test tab. Why doesn't 'with' properly restrict the sql
method to just one input? Is there another way to have a sql method be able to
take more than one variable, but only feed it one at a time?
Thanks in advance,