Ejemplo n.º 1
0
 def find_by_keys(self, __type_id, __use_id, __technology_id, session=None):
     if session is None:
         session = DBSession()
     return session.query(LightInfosBean)\
         .filter(LightInfosBean.type_id == __type_id) \
         .filter(LightInfosBean.use_id == __use_id) \
         .filter(LightInfosBean.technology_id == __technology_id).first()
Ejemplo n.º 2
0
 def select_by_page(self, offset, limit, session=None):
     """查询,offset起始位置,limit 返回条数 """
     if session is None:
         session = DBSession()
         return session.query(TypeBean).offset(offset).limit(limit).all()
Ejemplo n.º 3
0
 def count_type(self, session=None):
     """总数"""
     if session is None:
         session = DBSession()
     return session.query(TypeBean).count()
Ejemplo n.º 4
0
 def find_by_key(self, __id, session=None):
     if session is None:
         session = DBSession()
     return session.query(TypeBean).filter(TypeBean.type_id == __id).first()
Ejemplo n.º 5
0
 def select_by_model(self, __model_id, session=None):
     if session is None:
         session = DBSession()
     return session.query(TypeBean).filter_by(model_id=__model_id).all()
 def find_by_type_use(self, __type_id, __use_id, session=None):
     if session is None:
         session = DBSession()
     return session.query(TechnologyBean)\
         .filter(TechnologyBean.type_id == __type_id) \
         .filter(TechnologyBean.use_id == __use_id).all()
Ejemplo n.º 7
0
 def select_by_type(self, __type_id, session=None):
     if session is None:
         session = DBSession()
     return session.query(LightBean).filter_by(type_id=__type_id).all()
Ejemplo n.º 8
0
 def select_all(self, entity, session=None):
     if session is None:
         session = DBSession()
     return session.query(entity).all()
Ejemplo n.º 9
0
 def select_by_manufacturer(self, __manufacturer_id, session=None):
     if session is None:
         session = DBSession()
     return session.query(ModelBean).filter_by(
         manufacturer_id=__manufacturer_id).all()
Ejemplo n.º 10
0
 def find_by_key(self, __id, session=None):
     if session is None:
         session = DBSession()
     return session.query(ModelBean).filter(
         ModelBean.model_id == __id).first()
Ejemplo n.º 11
0
 def find_by_key(self, __id, session=None):
     if session is None:
         session = DBSession()
     return session.query(UrlManager).filter(UrlManager.id == __id).first()
Ejemplo n.º 12
0
 def find_by_url(self, __url, session=None):
     if session is None:
         session = DBSession()
     return session.query(UrlManager).filter(
         UrlManager.url == __url).first()