Python 检查ponyorm是否存在PrimaryKey
我正在尝试使用小马orm来查看是否存在主键。我走了这么远,但总是出错Python 检查ponyorm是否存在PrimaryKey,python,ponyorm,Python,Ponyorm,我正在尝试使用小马orm来查看是否存在主键。我走了这么远,但总是出错 class Favorite(db.Entity): game = Required(Game) user = Required(User) date_favorited = Required(datetime) PrimaryKey(user, game) 下面是函数 if Favorite.get(lambda: user, game) is not None: f
class Favorite(db.Entity):
game = Required(Game)
user = Required(User)
date_favorited = Required(datetime)
PrimaryKey(user, game)
下面是函数
if Favorite.get(lambda: user, game) is not None:
favorited = 1
这是errro
TypeError: The second positional arguments should be globals dictionary. Got: Game[12]
他在医院里得到了帮助
if Favorite.exists(user=x, game=y):
favorited = 1