Ejemplo n.º 1
0
 def find_by_name(cls, name):
     return db.session.query(FoodModel).filter(
         lower(unaccent(FoodModel.name)) == lower(unaccent(name))).first()
Ejemplo n.º 2
0
 def find_foods(cls):
     return cls.query.order_by(unaccent(FoodModel.name)).all()
Ejemplo n.º 3
0
 def find_brands(cls):
     return cls.query.order_by(unaccent(BrandModel.name)).all()
Ejemplo n.º 4
0
 def find_chemicals(cls):
     return cls.query.filter(ChemicalModel.name != 'Nenhum').order_by(unaccent(ChemicalModel.name)).all()
 def find_by_brand_food(cls, brand_id, food_id):
     return cls.query.filter_by(id_brand=brand_id, id_food=food_id).order_by(unaccent(text("name")))
Ejemplo n.º 6
0
 def find_by_brand(cls, brand_id):
     return cls.query.filter_by(id_brand=brand_id).order_by(
         unaccent(text("brand_1.name")))
Ejemplo n.º 7
0
 def find_by_food(cls, food_id):
     return cls.query.filter_by(id_food=food_id).order_by(
         unaccent(text("food_1.name")))