def site(request): noimage = request.params.get('noimage') if(noimage): query = select([ Site.Name.label('title'), Site.Country.label('country'), Site.Locality.label('locality'), Site.LongName.label('legend'), Site.UILabel.label('label') ]).where(Site.Name == dbConfig['siteName']) else : query = select([ Site.Name.label('title'), Site.Country.label('country'), Site.Locality.label('locality'), Site.LongName.label('legend'), Site.ImageBackPortal.label('imgBackPortal'), Site.ImageLogoPortal.label('imgLogoPortal'), Site.BackgroundHomePage.label('imgBackHomePage'), Site.UILabel.label('label') ]).where(Site.Name == dbConfig['siteName']) result = DBSession.execute(query).fetchone() print('*************************') #print(dict(result)) return dict(result)
def instance(request): table = Base.metadata.tables['VAllUsersApplications'] query = select([ table ]).where((table.c['TUse_PK_ID'] == request.authenticated_userid) & (table.c['TRol_Label'] != 'Interdit')).order_by(table.c['TIns_Order']) result = DBSession.execute(query).fetchall() return [dict(row) for row in result]
def users(request): """Return the list of all the users with their ids. """ query = select([ User.id.label('PK_id'), User.Login.label('fullname') ]).where(User.HasAccess == True).order_by(User.Lastname, User.Firstname) return [dict(row) for row in DBSession.execute(query).fetchall()]
def users(request): """Return the list of all the users with their ids. """ query = select([User.id.label('PK_id'), User.Login.label('fullname') ]).where(User.HasAccess == True).order_by( User.Lastname, User.Firstname) return [dict(row) for row in DBSession.execute(query).fetchall()]
def current_user(request): """Return the list of all the users with their ids. """ query = select([User.id.label('PK_id'), User.Login.label('fullname') ]).where(User.id == request.authenticated_userid) print return dict(DBSession.execute(query).fetchone())
def current_user(request): """Return the list of all the users with their ids. """ query = select([ User.id.label('PK_id'), User.Login.label('fullname') ]).where(User.id == request.authenticated_userid) return dict(DBSession.execute(query).fetchone())
def site(request): query = select([ Site.Name.label('title'), Site.Country.label('country'), Site.Locality.label('locality'), Site.LongName.label('legend'), Site.ImageBackPortal.label('imgBackPortal'), Site.ImageLogoPortal.label('imgLogoPortal'), Site.BackgroundHomePage.label('imgBackHomePage'), Site.UILabel.label('label') ]).where(Site.Name == dbConfig['siteName']) result = DBSession.execute(query).fetchone() return dict(result)