Hello.

Im trying to preprocess SQLFORM fields before they are saved into the 
database, for example given a table like 
the model:
db.define_table("people",
   Field('first_name', 'string'),
   Field('last_name', 'string')
)

I want to capitalize first and last name before they are saved into the 
database. Its not validation what im looking for but process specific 
fields as i like.

Ive tried:
db.people.first_name.represent = str.capitalize 
db.people.last_name.represent = str.capitalize
but doesnt seem to do anything.

the controller:
def index():
    form = SQLFORM(db.people)
    if form.process().accepted:
        message = "Updated" 
    return locals()

Thanks.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to