[Zope-DB] Giving the user the option to view certain fields in a query

Charlie Clark charlie at egenix.com
Thu May 6 11:11:58 EDT 2004


On 2004-05-06 at 16:24:01 [+0200], Laura McCord wrote:
> 
> Is it at all possible to add checkboxes for each field of the select
> statement in a form? I want to allow my user to view the query anyway
> they want. So if the user only wants to see the username of the
> resulting query instead of all of the fields in the table they would
> check the username box. Is this possible?

Hi Laura,

using Zope as with every other product requires you to do some work and 
some thinking!

Of course, this is possible
Add something like <input type="checkbox" name="display:list" 
value="username">

You can then check for this in a ZPT

<body tal:define="display request/display | nothing>
<table tal:condition="exists: fields">
<tr>
<td tal:repeat="field display" tal:content="field"></td>
</tr>
</table>
</body>

Now this is the won't really get you what you want and isn't the best way 
to solve your problem and will be _slow_ to run. You would be much better 
off doing the work in a Script before you get this far.

However, the nice thing about Zope is that other people have already had to 
address similar problems and have come up with solutions for them. This 
might be the case with Formulator but more likely something like 
ZNolkSQLWizard (or something similar) will do the job and more.

Charlie



More information about the Zope-DB mailing list