You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
665 B

  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # See __openerp__.py about license
  5. #
  6. ##############################################################################
  7. from openerp import models, fields
  8. class IrModelFieldsRegex(models.Model):
  9. _name = "ir.model.fields.regex"
  10. name = fields.Char('Description', required=True)
  11. regex = fields.Char(
  12. 'Regular Expression', required=True,
  13. help="Regular expression used to validate the field. For example, "
  14. "you can add the expression\n%s\nto the email field"
  15. % r'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b')