]>
git.datanom.net - pwp.git/blob - app/DB/base.py
5 cur
= self
.conn
.cursor()
16 def update(self
, sql
, placeholders
):
18 cur
= self
.conn
.cursor()
20 cur
.execute(sql
, placeholders
)
23 except Exception as e
:
31 def insert(self
, sql
, placeholders
):
33 cur
= self
.conn
.cursor()
35 cur
.execute(sql
, placeholders
)
36 if self
.__class
__.__name
__ == 'Postgres':
37 cur
.execute('select lastval()')
38 lastid
= cur
.fetchone()[0]
40 lastid
= cur
.lastrowid
42 except Exception as e
:
51 cur
= self
.conn
.cursor()
53 if self
.__class
__.__name
__ == 'Mysql':
54 for r
in cur
.execute(sql
, multi
=True):
59 except Exception as e
:
66 #print("%s: deleted" % self.__class__.__name__)
70 except AttributeError:
This page took 0.082188 seconds and 6 git commands to generate.