Hi guys, Perhaps someone could help me past this small enigma. I'm attempting to set up a simple CRUD for use with the identity, as a useful exercise. I started with some code generated from another model and tg-crud, and also referring to the turbogears book.
My code is here: http://paste.turbogears.org/paste/1495 And it closely resembles this working code, from the turbogears book site: http://paste.turbogears.org/paste/1494 When I fill in my form incorrectly such that the email validation should fail, I get errors the tail of which reads: File "/Users/rangi/ricochet/trunk/ricochet/UserController/controllers.py", line 66, in form return dict(values=values, form=user_form, action=submit_action) UnboundLocalError: local variable 'values' referenced before assignment And the URL for this is: http://localhost:8080/user/save/4 So it seems to me that the save method is calling the form method as it's error handler. The form method parses the URL and it contains neither "new" or "edit", because it's actually "save". So the assignments to "values" is nested in if blocks that aren't evaluated to true. That makes sense to me, I think. So the error isn't strange. What is strange is that the bookmarker example doesn't do this!?! The code's logic to my noob eyes looks the same. I'd like to use the bookmakers' mechanism as it seems simple and contained, but there's magic there I don't understand. Can someone shed some light please? Cheers, Rangi. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---

