我正在尝试使用pony 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:
favorited = 1
这是错误的
TypeError: The second positional arguments should be globals dictionary. Got: Game[12]