Skip to content

Commit

Permalink
update_annotation gets db_file to make the change
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrdadbakhtiari committed Jun 19, 2019
1 parent 4123989 commit 798e211
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions advntr/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ def update_trained_score_in_database(vntr_id, scaled_recruitment_score):
db.close()


def update_gene_name_and_annotation_in_database(vntr_id, gene_name, annotation):
db = sqlite3.connect(settings.TRAINED_MODELS_DB)
def update_gene_name_and_annotation_in_database(vntr_id, gene_name, annotation, db_file=None):
if db_file is None:
db_file = settings.TRAINED_MODELS_DB
db = sqlite3.connect(db_file)
cursor = db.cursor()
cursor.execute('''UPDATE vntrs SET gene_name=?, annotation=? WHERE id=?''', (gene_name, annotation, vntr_id))
db.commit()
Expand Down

0 comments on commit 798e211

Please sign in to comment.