Hi!
Can you suggest me how can I write a validator for sql table names?

I mean... I have a plugin that let me define tables and fields through the web interface saving their name and parameters in the db itself. So I have a "meta" table for the tables I want to define. I'm looking for a good validator for the "meta" field that contains table names.

They have to be unique and respect all SQL conventions. At the moment I solved in this way:

Field('tab_name', label=T('Table name'), unique=True, required=True,
requires=IS_MATCH('^[a-z0-9_]*$', error_message=T('Not a valid table name!')))

Thank you very mutch

    Manuele

Reply via email to