Hi all,

I am a beginner in python and web. Have a novice question, out of
curosity, on how exactly turbogears preserve the old form values after
an error occurs, in the following pattern of usage:

    @expose(template="project.templates.form")
    def profile(self, tg_errors=None, tg_exceptions=None):
        if tg_errors:
            flash("Error: " + str(tg_errors))
        if tg_exceptions:
            flash("Exception: " + str(tg_exceptions))
        u = identity.current.user
        value = {
            'user_id' : u.user_id,
            'user_name' : u.user_name,
            'email_address' : u.email_address,
            'first_name' : u.display_name,
            'password' : u.password,
            'password2' : u.password
        }
       return dict(
           form=profile_form,
           action='save',
           title='User Profile',
           value=value
        )

    @expose()
    @turbogears.validate(form=profile_form)
    @turbogears.error_handler(profile)
    @turbogears.exception_handler(profile)
    def save(self,  **kw):
        .
        .
        .

As I know, after an error occurs in the save method, the profile method
gets called again. Now, walking through the profile method, after
flashing the error, the values are again being initialized. So, then,
how the old values still are shown in the form, is my curosity...

thanks
sanjay


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to