On Tue, 18 Jul 2006, Donald Ball wrote:

> Apologies for my appalling ignorance, but I'm having trouble with the lack
> of forms widget documentation. :) If I'm able to get this identity
> management app working, I'll be happy to wiki it on up for others to learn
> from.

And for once, I've solved my own problem. fwiw, the form template ought to 
read:

     <p py:content="form.display(user, action=action)">Comment form</p>

and the final editUser method:

     @expose(template=".templates.form")
     def editUser(self, tg_errors=None, *args, **params):
         if tg_errors:
             turbogears.flash("Error on form: " + str(tg_errors))
         id = params.get("id", None)
         if (id):
             try:
                 user = User.get(id)
                 user_form.display(user)
             except SQLObjectNotFound:
                 raise NotFound()
         else:
            user = None
        return dict(form=user_form, user=user, action='saveUser', title='Edit 
User')

Now I just need to figure out how to allow the form to have multiple 
submit buttons (edit, delete) - conditionally enabled based on the user's 
privileges - and then I'll really be jamming.

- donald

--~--~---------~--~----~------------~-------~--~----~
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