diff options
| author | Stephane Wirtel <stephane@tinyerp.com> | 2008-12-18 17:13:19 +0100 |
|---|---|---|
| committer | Stephane Wirtel <stephane@tinyerp.com> | 2008-12-18 17:13:19 +0100 |
| commit | d8727111a67176e0ac9360fece92f81d6a602832 (patch) | |
| tree | ced9102695197f0a97a12d576a1e5d9718ee9881 /bin/sql_db.py | |
| parent | f510071f6b14a5534cadc0aced4dae67c60a2c79 (diff) | |
[IMP] Use the Cursor from sql_db
bzr revid: stephane@tinyerp.com-20081218161319-bo4jn6ouum0qy32y
Diffstat (limited to 'bin/sql_db.py')
| -rw-r--r-- | bin/sql_db.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/sql_db.py b/bin/sql_db.py index 5cbe3e7420a..1d5bfce89e7 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -136,10 +136,10 @@ class Cursor(object): return res def drop_view_if_exists(self, viewname): - self._obj.execute("select count(1) from pg_class where relkind=%s and relname=%s", ('v', viewname,)) - if self._obj.fetchone()[0]: - self._obj.execute("DROP view %s" % (viewname,)) - self._obj.commit() + self.execute("select count(1) from pg_class where relkind=%s and relname=%s", ('v', viewname,)) + if self.fetchone()[0]: + self.execute("DROP view %s" % (viewname,)) + self.commit() def print_log(self): def process(type): |
