[Zope-DB] How to pass values from a form to a page template?

Charlie Clark charlie at egenix.com
Thu Apr 29 02:49:39 EDT 2004


On 2004-04-29 at 08:16:59 [+0200], vaibhav  uprety wrote:
> Hi,
>   
> I have to create a  GUI which contains some Books that are stored as 
> object. Using the GUI one of the user defined roles are to be assigned to 
> each book so that it can be accessed by users on the basis of the roles 
> assigned to them.
> This thing has to be done using a GUI
> 
> I don't know the TAL in detail. Can anyone tell me how can i pass variables 
> to a template render so that it renders contents on the basis of values 
> passed to it?

Dear Vaibhav,

can you provide some more details as to how you want to pass the information, 
i.e. through an http-GET or POST or directly from one Zope object to another.

Assuming you are posting from the form then anything in the request is 
directly visible in the page template request namespace

ie.

<form action="myTemplate">
<input type="text" name="user_name" value="vaibhav">
<input type="submit">
</form>

when submitted this will pass the variables to the page template

<html>
<body tal:define="user request/user_name | nothing">
<p tal:content="user"></p>
</body>
</html>

Please see the PageTemplate documentation and sign up to zpt at zope.org if you 
have more questions.

Charlie

-- 
Charlie Clark
eGenix.com

Professional Python Services directly from the Source
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the Zope-DB mailing list