[Zope] Building add form on the fly

Bernie Simon bsimon@stsci.edu
Fri, 01 Jun 2001 11:34:50 -0400


I'm trying to build the add form for my product in Python rather than
just read in a dtml file. However when I try to create an instance of
the product, it pops up an authorization form. Typing in my username and
password doesn't work and I get a user authorization error. There's
something about permissions that I don't understand. So I'm asking the
list for help. 

Here's the old code that works:

manage_addNotableForm = HTMLFile('dtml/notableAddForm', globals())

and here's the new code that has the authorization problem:

def buildAddNotableForm ():
    "Build the form to add a news/calendar folder"

    str = """<html> 
    <head><title>Add News/Calendar Folder</title></head> 
    <body bgcolor="#ffffff" link="#000099" vlink="#555555"> 
    <h2>Add News/Calendar Folder</h2> 

    <form action="manage_addNotable">
    <table> 
    <tr><th>Folder Id</th> 
    <td><input type="text" name="id" size="40"></td> 
    </tr>

    <tr><th></th><td><input type=submit value=" Create "></td></tr> 
    </table>
    </form> 
    </body>
    </html> 
    """

    return HTML(str)

manage_addNotableForm = buildAddNotableForm()

-- 
Bernie Simon					http://ra.stsci.edu/bps/