I love web2py, but I hate the convention of all uppercase separated
with commas in validators.  It's like hitting a speed bump when you're
doing 80. I am experimenting with converting them to camelcase in my
model and it seems to work fine.

def camelcase_validators():
    from gluon.validators import __all__ as all_validators
    cmd = ";".join([ ''.join([a.lower().capitalize() for a in v.split
("_")]) + "=" + v for v in all_validators])
    return cmd

exec(camelcase_validators())

My questions:
1) Is there a better way?
2) Is exec really that bad?

I know it's a silly venture, but indulge me :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to