Untitled

 avatar
unknown
plain_text
5 months ago
663 B
2
Indexable
stmt = (
        info.context.session.query(Product)
        .join(ProductCountry, Product.id == ProductCountry.id)
        .join(UsersCountry, ProductCountry.country_id == UsersCountry.country_id)
        .join(UsersTherapeutic, Product.th_area == UsersTherapeutic.ta_id)
        .filter(UsersCountry.user_id == info.context.current_user.id)
        .filter(UsersTherapeutic.user_id == info.context.current_user.id)
        .filter(Product.is_deleted != 2)
        .filter(
            or_(
                Product.last_active > 0,
                Product.current_record == 1,
                Product.is_deleted == 1,
            )
        )
    )
Editor is loading...
Leave a Comment