Skip to content

Commit

Permalink
Update Create Row from JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Jul 29, 2019
1 parent a2d8050 commit 58e4dba
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions common/database_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,8 @@ def create_row_from_json(table, json):
:param json: the dictionary containing the values
:return: nothing atm
"""
log.info(f" Creating row from json into table {table.__tablename__}")
session = get_icat_db_session()
record = table()
record.update_from_dict(json)
record.CREATE_TIME = datetime.datetime.now() # These should probably change
record.CREATE_ID = "user"
record.MOD_TIME = datetime.datetime.now()
record.MOD_ID = "user"
session.add(record)
session.commit()
log.info(" Closing db session")
session.close()
create_query = CreateQuery(table, json)
create_query.execute_query()


def get_row_by_id(table, id):
Expand Down

0 comments on commit 58e4dba

Please sign in to comment.