def login_user(): try: DBSession = DBConnection().getsession() Query = DBSession.execute('select * from tbl_byonic_user').fetchall() return Query except: return False
def UPDATE_NEW_PASSWORD(self): id = self.id conn = DBConnection().getEngine() metadata = DBConnection().metadata() byonic_user = Table('tbl_byonic_user', metadata, autoload=True, autoload_with=conn) query = select([byonic_user.columns.user_role_id, byonic_user.columns.user_first_name]).where(byonic_user.columns.user_role_id==1) ResultProxy = conn.execute(query).fetchall() # ResultSet = pd.read_sql(query, con=conn).to_json(orient='records') conn.close() # print(ResultProxy.fetchall()) values = ['user_role_id', 'user_first_name'] dictionary = [] print(ResultProxy) for i in range(len(ResultProxy)): files = dict(zip(values, ResultProxy[i])) dictionary.append(files) campaign_view = {'campaign_view': dictionary} print(campaign_view) return