我正在尝试使用小马 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]