osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Peewee ORM questions


Hi all,

couldn't find a group for Peewee, so here I am:

Given a table structure of 

{'id': <AutoField: User.id>, 
 'username': <CharField: User.username>, 
 'password': <CharField: User.password>, 
 'created': <DateTimeField: User.created>, 
 'updated': <DateTimeField: User.updated>}

Using playhouse.shortcuts:

def ListAll(model):
    for row in model.select():
        print(model_to_dict(row, exclude = (row.created, row.updated)))

still returns the created and updated columns....

Broken? Or - way more likely - something I am doing wrong?

Thanks for all help!

Tua