python - Check if PrimaryKey exists with ponyorm -


i trying use pony orm see if primary key exists. got far, throws error.

class favorite(db.entity):     game = required(game)     user = required(user)     date_favorited = required(datetime)     primarykey(user, game) 

here function

    if favorite.get(lambda: user, game) not none:         favorited = 1 

here errro

typeerror: second positional arguments should globals dictionary. got: game[12] 

was helped out in github repo

if favorite.exists(user=x, game=y):     favorited = 1 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -