Bigzhu's den

sqlalchemy 中对 jsonb 进行条件判断

bigzhu

要转换为 jsonb 来比较

    from sqlalchemy.dialects.postgresql import JSONB
    from sqlalchemy.sql.expression import cast
    q = session.query(God).filter(God.twitter.isnot(None)
                                  ).filter(God.twitter['name'] != cast("", JSONB))
bigzhu
Everything is learnable