def delete_from_db(item, msg='Deleted from db'):
 try:
  logging.info(msg)
  db.session.delete(item)
  logging.info('removed from session')
  db.session.commit()
  return True
 except Exception as error:
  logging.error(('DB Exception! %s' % error))
  db.session.rollback()
  return False

def delete_from_db ( item , msg = 'Deleted from db' ) : try : logging . info ( msg ) db . session . delete ( item ) logging . info ( 'removed from session' ) db . session . commit ( ) return True except Exception as error : logging . error ( ( 'DB Exception! %s' % error ) ) db . session . rollback ( ) return False
convenience function to wrap a proper db delete .