0
我用peewee相關與exsits表:如何根據定義的Jsonfield判斷一個元素是否在列表中?
import peewee
from playhouse.postgres_ext import *
class Rules(peewee.Model):
channels = JSONField(null=True)
remark = peewee.CharField(max_length=500, null=True)
class Meta:
database = db
db_table = 'biz_rule'
schema = 'opr'
例如:在我的表中存在的列頻道的記錄:
["A012102","C012102","D012102","E012102"]
我想判斷「A012102」是否在名單,如何編寫代碼?