[Zope] - creating a MySQL login form

Brian Lloyd Brian@digicool.com
Mon, 28 Dec 1998 13:54:56 -0500


> I'm just starting with Zope and have some questions:
> 
>   1. In the form below, it gives me this error when calling 
> manage_open_connection:
> 
> <!--
>  Error type:  
>  Error value: PATH_INFO
>  -->
> 
> what is wrong with the call?
> 
>   2. If I change 'conn' to user in the 
> manage_addZMySQLConnection(), how do I address user in 
> manage_open_connection()? i.e.
> 
> MySQL.manage_addZMySQLConnection(user, ...)
> MySQL.user.manage_open_connection()
> 
> is what I'm trying to accomplish.

I'm not understanding what you are trying to do here - why
would you create a new database connection for each user?

In Zope, you usually only need to add a single db connection
object (by using "Add" in the management interface, not through
code). Then you Add Z SQL Method objects, which encapsulate the
various queries you want to run. The SQL Method objects just use
the existing database connection.



> 
>   3. How do I trap exceptions in DTML (i.e. if login fails)?

If you need to trap an exception, you should probably use an
External Method - DTML does not let you handle exceptions 
directly.

Hope this helps!

Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com