Search code examples
web2py

web2py write in lowercase in UPEERCASE field


i've got a " requires = IS_UPPER()" field in my table, i need to sometimes write in lowercase, there is a way to do that? I have tried to use html quote or unicode tag but without any results. Thank you


Solution

  • You can set the validator conditionally:

    if some_condition:
        db.mytable.myfield.requires = None # or some other validator