[Zope-DB] Creating Forms

Laura McCord Laura.McCord at doucet-austin.com
Wed Apr 28 09:14:05 EDT 2004

Just to clarify some things:

<td><span><a tal:attributes="href python: 'userEdit_Form?userid=' +

 This means that it will take me to the edit form and it attaches the
userid variable to the request. So that is what the ?userid=... means.

<table repeat="result python: context.qUser(userid=userid)">
<tr><td><input type="text" name="userid" 

 I don't understand what qUser is. Could you explain to me what that

Thank you for your help.

-----Original Message-----
From: Charlie Clark [mailto:charlie at begeistert.org] 
Sent: Wednesday, April 28, 2004 3:02 AM
To: Laura McCord
Cc: zope-db at zope.org
Subject: Re: [Zope-DB] Creating Forms

I don't know anything about using Formulator - I never quite understood
to use it myself but a lot of people seem to like it. It's from Maartijn

Faassen and available on zope.org.

However, I think it isn't necessary to solve your problem and it's
a good idea to go through the steps of how to do this in Zope with

All you need to do is to pass some kind of identifier to the edit page
order to display things; userifd would be good.

Your URL-link would be "user_EditForm?userid=1" for example.

In user_EditForm you can read this id in from the request and pass it to
ZSQL-Method to get the data. You then use tal:attributes to fill out the


Some snippets:

<td><span><a tal:attributes="href python: 'userEdit_Form?userid=' + 

<body tal:define="userid request/userid | nothing>
<form tal:condition="userid">
<table repeat="result python: context.qUser(userid=userid">
<tr><td><input type="text" name="userid" 
tal:attributes="value result/userid" tal:content="result/userid"></td>
</tr> </table> </form>

Hope that gets you started. This is essentially TALES work so you might 
want to sign up to the ZPT mailing list if you need more help.


On 2004-04-27 at 22:07:46 [+0200], Laura McCord wrote:
> I am a newbie at creating forms, I only know the basics. What I need 
> to do is the following:
> I have a list of users:
> 1 jane jane at blah.com  texas
> 2 jim  jim at blah.com   california
> 3 jill jill at blah.com  florida
> I want the user's name (Example, Jill) to be linkable to an edit form 
> but I want the edit form to be pre-populated with the user's 
> information. Does anyone have any ideas on how to do this? I am using 
> the 'Z Search Interface' to display all of the users.
> So, perhaps in this block of code the link can be created. But, I 
> don't know what to  include to send the user information to the edit 
> form to pre-populate the form fields.
> <div tal:repeat="result batch" >
>          <tr>
>           <td><span tal:replace="result/userid" >userid</span></td>
>           <td><span tal:replace="result/username">username</span></td>
>           <td><span tal:replace="result/useremail">useremail goes 
> here</span></td>
>           <td><span tal:replace="result/useroffice">useroffice goes 
> here</span></td>
>           <td><span tal:replace="result/userpwd">userpwd goes 
> here</span></td>
>           <td><span tal:replace="result/userpwdchg">userpwdchg goes 
> here</span></td>
>           <td><span tal:replace="result/pcname">pcname goes 
> here</span></td>
>           <td><span><a href="userEdit_Form" 
> name=username>[edit]</a></span>
>         </tr>
>  </div>
> Thanks,
>  Laura

More information about the Zope-DB mailing list