Hey pals,
I am new to T2. It is really convenient such as t2.create(db.config)
or t2.update(db.config,query). But I do not find a way to customize
form validation. In t2.pdf I only found the "onaccept" callback, but
it is called AFTER the form is accepted - NOT what I want.
Finally I used this clumsy approach. Is there a better way?
def create():
import os,os.path
if request.vars.logdir:# Same blah happens in update()
if not os.path.isdir(request.vars.logdir): # I need to make sure
this
response.flash='Dir not exist: %s'%request.vars.logdir
return {'Oops':A('Try again',_href=URL(r=request,f='create'))}
return {'Create':t2.create(db.config)}
Thanks in advance.
Iceberg
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---