Skip to content

Commit

Permalink
#3208: setup_tables.py, use 'executemany'
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff1evesque committed Mar 26, 2018
1 parent b39998f commit e33249c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,13 @@ class VARCHAR (50) NOT NULL
query = '''\
INSERT INTO RoleType (RoleType) VALUES (%s);
'''
args = 'default'
args = ('default')
cur.execute(query, args)

query = '''\
INSERT INTO Role (RoleOwner, RoleTypeID, UserID) VALUES (%s, %s, %s);
'''
args = (0, 0, 0)
args = ('0', '1', '1')
cur.execute(query, args)

# ################################################################################# #
Expand All @@ -372,7 +372,7 @@ class VARCHAR (50) NOT NULL
query = '''\
INSERT INTO ModelType (ModelType) VALUES (%s);
'''
cur.execute(query, model_types)
cur.executemany(query, model_types)

# ################################################################################# #
# #
Expand All @@ -382,4 +382,4 @@ class VARCHAR (50) NOT NULL
query = '''\
INSERT INTO ResultType (ResultType) VALUES (%s);
'''
cur.execute(query, result_types)
cur.executemany(query, result_types)

0 comments on commit e33249c

Please sign in to comment.