← Back to team overview

avanzosc team mailing list archive

[Merge] lp:~mikelarregi/avanzosc/nayar_mysql into lp:~avanzosc-security-team/avanzosc/72horas

 

mikel arregi has proposed merging lp:~mikelarregi/avanzosc/nayar_mysql into lp:~avanzosc-security-team/avanzosc/72horas.

Requested reviews:
  Avanzosc_security (avanzosc-security-team)

For more details, see:
https://code.launchpad.net/~mikelarregi/avanzosc/nayar_mysql/+merge/226118

nayar_mysql_connect
-- 
https://code.launchpad.net/~mikelarregi/avanzosc/nayar_mysql/+merge/226118
Your team Avanzosc_security is requested to review the proposed merge of lp:~mikelarregi/avanzosc/nayar_mysql into lp:~avanzosc-security-team/avanzosc/72horas.
=== modified file 'nayar_mysql_connect/__init__.py'
--- nayar_mysql_connect/__init__.py	2014-06-11 10:23:47 +0000
+++ nayar_mysql_connect/__init__.py	2014-07-09 12:57:13 +0000
@@ -19,6 +19,6 @@
 #
 ##############################################################################
 
-import mysql_connect
+from . import models
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'nayar_mysql_connect/__openerp__.py'
--- nayar_mysql_connect/__openerp__.py	2014-06-11 10:23:47 +0000
+++ nayar_mysql_connect/__openerp__.py	2014-07-09 12:57:13 +0000
@@ -20,16 +20,12 @@
 ##############################################################################
 
 {
-    "name" : "Nayar MySql Connect",
-    "version" : "1.0",
-    "author" : "Nayar Systems",
-    "category" : "Base",
-    "website" : "",
+    "name": "Nayar MySql Connect",
+    "version": "1.0",
+    "author": "Nayar Systems",
+    "category": "Base",
+    "website": "",
     "description": "This module allows you connect to a MySql database.",
-    "depends" : ['dos_mysql_connect'],
-    "init_xml" : [],
-    "update_xml" : [],
-    "active": False,
+    "depends": ['dos_mysql_connect'],
     "installable": True
 }
-

=== added directory 'nayar_mysql_connect/models'
=== added file 'nayar_mysql_connect/models/__init__.py'
--- nayar_mysql_connect/models/__init__.py	1970-01-01 00:00:00 +0000
+++ nayar_mysql_connect/models/__init__.py	2014-07-09 12:57:13 +0000
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2012-2013 Nayar Systems (<http://www.72horas.net/>)
+#
+#    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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from . import mysql_connect
\ No newline at end of file

=== renamed file 'nayar_mysql_connect/mysql_connect.py' => 'nayar_mysql_connect/models/mysql_connect.py'
--- nayar_mysql_connect/mysql_connect.py	2014-06-11 10:23:47 +0000
+++ nayar_mysql_connect/models/mysql_connect.py	2014-07-09 12:57:13 +0000
@@ -19,14 +19,15 @@
 #
 ##############################################################################
 
-from osv import osv
-
-class mysql_connect(osv.osv):
+from openerp.osv import orm
+
+
+class MysqlConnect(orm.Models):
     _inherit = 'mysql.connect'
     db = None
 
     def open_connection(self, cr, uid):
-        self.db = super(mysql_connect, self).open_connection(cr, uid)
+        self.db = super(MysqlConnect, self).open_connection(cr, uid)
         return self.db
 
     def query(self, query_str, param=None):
@@ -51,8 +52,6 @@
             return None
 
     def close_connection(self, db=None):
-        res = super(mysql_connect, self).close_connection(self.db)
+        res = super(MysqlConnect, self).close_connection(self.db)
         self.db = None
         return res
-
-mysql_connect()


Follow ups