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.
19 lines
708 B
19 lines
708 B
# -*- coding: utf-8 -*-
|
|
# Copyright © 2014-2016 Lorenzo Battistini - Agile Business Group
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from openerp import models, fields
|
|
|
|
|
|
class IrModelFieldsRegex(models.Model):
|
|
_name = "ir.model.fields.regex"
|
|
name = fields.Char('Description', required=True)
|
|
regex = fields.Char(
|
|
'Regular Expression', required=True,
|
|
help="Regular expression used to validate the field. For example, "
|
|
"you can add the expression\n%s\nto the email field"
|
|
% r'[^@]+@[^@]+\.[^@]+')
|
|
_sql_constraints = [(
|
|
'name_unique', 'unique (name)',
|
|
'The name of a regular expression must be unique'
|
|
)]
|