Hi,
I have a problem about the controller programing.
I have some java programming background, i like to include the
operation code block into a try-except block, so, i do the controller
method like this:
def edit(self, id):
return_render = None
try :
# something for edit and database read or write
if form_data_format_error:
# re-show the edit form and show the error message on
the page
return_render = render_response('edit_template.myt')
else:
# write to the database and redirect to the user to the
list
return_render = redirect_to(action='list')
except:
print sys.exc_info()
return_render = render_response('error_exception.myt')
return return_render
I know these kind of code has some problem. The redirect_to do not
work correctly.
Can you help me for the correct way to make this work?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---