i'm trying to get this logic flow done ( i cut a bit out ):
@expose(template="templats.myForm")
def form_print(self , **data ):
options = {}
value = {}
return dict ( form = self.form , value=value , option = options )
@expose()
@validate=(form=myForm)
@error_handler=(form_print)
def form_process( self , **data ):
if cherrypy.session['registered']:
return dict( self.failure__already_registered_verified( **data
) )
else:
return dict( self.form_process_real( **data ) )
def failure__already_registered_verified( self , **data ):
return dict(
tg_template = 'templates. failure__already_registered_verified'
,
user_email = data['email']
)
def form_process_real ( self , data ):
emailer = TurboEmail(stuff)
if not emailer.send_text():
print "how the hell do i return to the original form?"
return
return dict(
tg_template="templates.success",
user_email = data['email']
)
everything i want to do works fine, until i want to do this:
in the section marked "how the hell do i return to the oringinal
form?" i want to do this:
give the output of 'form_print' (ie, validated & filled out ), but
with an error message tossed in saying "there's an error sending mail.
please hit submit again. if it persists, please contact [EMAIL PROTECTED]"
my issue is that i can either mangle the **data or the template
into the function correctly, but i can't get them both into the
function using this method.
i'm hoping that there's some what i can just do this:
tg_errors['_email_sending'] = 1 # which i'll catch in the
function
tg_raise_error( form_print ) # which would treat things as if i
called the error
anyone have a clue?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---