예제 #1
0
 def find_by_name(cls, name):
     return db.session.query(FoodModel).filter(
         lower(unaccent(FoodModel.name)) == lower(unaccent(name))).first()
예제 #2
0
 def find_foods(cls):
     return cls.query.order_by(unaccent(FoodModel.name)).all()
예제 #3
0
 def find_brands(cls):
     return cls.query.order_by(unaccent(BrandModel.name)).all()
예제 #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")))
예제 #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")))
예제 #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")))