[web2py] Re: Processing user entries prior to database commit

2012-12-17 Thread Niphlod
there's one additional detail before anyone can reply. If the user inserts JoHN DOe, the data on the database must be saved preserving the case sensitivity the user used? i.e. when the user comes back should he see JoHN DOe the way he inserted it or John Doe ? Il giorno lunedì 17 dicembre

[web2py] Re: Processing user entries prior to database commit

2012-12-17 Thread Massimo Di Pierro
assuming db.define_table('person',Field('fullname')) db.define_table('thing',Field('name'),Field('belongsto','reference person')) you can define a function to capitalized a name def capitalize(name): return ' '.join(t.capitalize() for t in (name or '').split()) You can use to change