From 04b524be5d96ee94d75507a4fb2ad2d12ff80fd6 Mon Sep 17 00:00:00 2001 From: eLBati Date: Mon, 7 Sep 2015 09:56:43 +0200 Subject: [PATCH] IMP dir struct and copyright --- base_field_validator/__init__.py | 18 ++--------- base_field_validator/__openerp__.py | 6 ++-- .../{ => demo}/ir_model_demo.xml | 0 base_field_validator/ir_model_field_regex.py | 31 ------------------- base_field_validator/models/__init__.py | 8 +++++ base_field_validator/{ => models}/ir_model.py | 15 +-------- .../models/ir_model_field_regex.py | 18 +++++++++++ .../{ => views}/ir_model_view.xml | 0 8 files changed, 32 insertions(+), 64 deletions(-) rename base_field_validator/{ => demo}/ir_model_demo.xml (100%) delete mode 100644 base_field_validator/ir_model_field_regex.py create mode 100644 base_field_validator/models/__init__.py rename base_field_validator/{ => models}/ir_model.py (83%) create mode 100644 base_field_validator/models/ir_model_field_regex.py rename base_field_validator/{ => views}/ir_model_view.xml (100%) diff --git a/base_field_validator/__init__.py b/base_field_validator/__init__.py index e556f3b5c..142483d70 100644 --- a/base_field_validator/__init__.py +++ b/base_field_validator/__init__.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Copyright (C) 2014 Agile Business Group sagl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# See __openerp__.py about license # ############################################################################## -from . import ir_model -from . import ir_model_field_regex +from . import models diff --git a/base_field_validator/__openerp__.py b/base_field_validator/__openerp__.py index d75943e2c..e961b0c27 100644 --- a/base_field_validator/__openerp__.py +++ b/base_field_validator/__openerp__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Copyright (C) 2014 Agile Business Group sagl () +# Copyright (C) 2014-2015 Lorenzo Battistini - Agile Business Group # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published @@ -28,11 +28,11 @@ 'license': 'AGPL-3', "depends": ['base'], "data": [ - 'ir_model_view.xml', + 'views/ir_model_view.xml', 'security/ir.model.access.csv', ], "demo": [ - 'ir_model_demo.xml', + 'demo/ir_model_demo.xml', ], 'test': [ 'test/validator.yml', diff --git a/base_field_validator/ir_model_demo.xml b/base_field_validator/demo/ir_model_demo.xml similarity index 100% rename from base_field_validator/ir_model_demo.xml rename to base_field_validator/demo/ir_model_demo.xml diff --git a/base_field_validator/ir_model_field_regex.py b/base_field_validator/ir_model_field_regex.py deleted file mode 100644 index 64afea9b3..000000000 --- a/base_field_validator/ir_model_field_regex.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2014 Agile Business Group sagl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -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'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b') diff --git a/base_field_validator/models/__init__.py b/base_field_validator/models/__init__.py new file mode 100644 index 000000000..9cf6a39b9 --- /dev/null +++ b/base_field_validator/models/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# See __openerp__.py about license +# +############################################################################## +from . import ir_model +from . import ir_model_field_regex diff --git a/base_field_validator/ir_model.py b/base_field_validator/models/ir_model.py similarity index 83% rename from base_field_validator/ir_model.py rename to base_field_validator/models/ir_model.py index d4a6f99b6..5f87906d6 100644 --- a/base_field_validator/ir_model.py +++ b/base_field_validator/models/ir_model.py @@ -1,20 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Copyright (C) 2014 Agile Business Group sagl () -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# See __openerp__.py about license # ############################################################################## diff --git a/base_field_validator/models/ir_model_field_regex.py b/base_field_validator/models/ir_model_field_regex.py new file mode 100644 index 000000000..8e0a534a1 --- /dev/null +++ b/base_field_validator/models/ir_model_field_regex.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# See __openerp__.py about license +# +############################################################################## + +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'\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b') diff --git a/base_field_validator/ir_model_view.xml b/base_field_validator/views/ir_model_view.xml similarity index 100% rename from base_field_validator/ir_model_view.xml rename to base_field_validator/views/ir_model_view.xml