Exemple #1
0
 def simpleform(self):
     """
     no submit button...
     """
     request = get_request()
     
     w1 = widget.StringWidget(name='n', value='')
     w2 = widget.StringWidget(name='n2', value='')
     
     return "%s %s <form method=POST><input type=text name=n><input type=text name=n2></form>" % (w1.parse(request), w2.parse(request),)
Exemple #2
0
    def login(self):
        request = get_request()

        username_widget = widget.StringWidget(name='username',
                                              value='')
        submit_widget = widget.SubmitWidget(name='submit',
                                            value='submit me')
        submit_widget2 = widget.SubmitWidget(name='nosubmit2',
                                             value="don't submit")
        
        if request.form:
            assert not submit_widget2.parse(request)
            username = username_widget.parse(request)
            if username:
                session = get_session()
                session.set_user(username)
                return redirect('./')

        image_submit = '''<input type=image name='submit you' src=DNE.gif>'''
                
        return "<form method=POST>Log in: %s<p>%s<p>%s<p>%s</form>" % \
               (username_widget.render(),
                submit_widget2.render(),
                submit_widget.render(),
                image_submit)