according to the below question
SqlAlchemy Case with multiple conditions
how can I use below and_
without get the error of too many values to unpack (expected 2)
type_case = (
[
(Jobs.interview_type == 'adsfas', 0),
(Jobs.interview_type == 'asdfay', 1),
(and_(Jobs.interview_type == 'PHONE_SCREEN',
Jobs.interview_type == 'INCLINED',
Jobs.name == 'Python',
Jobs.age >= 18, 2)),
(and_(Jobs.interview_type == 'adgasd',
JobOther.interview_type == 'asgasd',
Jobs.name == 'PHP',
Jobs.age >= 18, 3))
],
else_=4
)
query = db.session.query(
type_case.label('whatever_type'),
).join(
Jobs,
Jobs.id == JobOther.id
)