def create(employee): new_employee = insert(Employees) \ .values(dict( id=employee['id'], slack_handle=employee['name'], name=employee['profile']['real_name'] )) execute = Session.execute(new_employee) Session.commit() return execute
def create(channel): new_channel = insert(Channels) \ .values(dict( id=channel['id'], name=channel['name'], channel_created=channel['created'] )) execute = Session.execute(new_channel) Session.commit() return execute
def toggle(slack_id, toggle): Session.query(Employees) \ .filter(Employees.id == slack_id) \ .update({'enabled': toggle}) return Session.commit()