class CastingArray(ARRAY):
def bind_expression(self, bindvalue):
return cast(bindvalue, self)
class Flavor(db.Model):
__tablename__ = 'flavor'
applications = Column(CastingArray(JSON))
flavor = Flavor(
applications = [
{
"category": "Bakery",
"recomended_dosage": 1,
"sub_application": "Baked goods",
"sub_application_details": [
"Bagels",
"Fillings"
]
}
]
)
list_category = ["Bakery", ...],
list_sub_application_detail = ["Bagels", ...]
我想尝尝
category
中的任何list_category
以及sub_application_details
中的任何list_sub_application_detail