keredson / peewee

a small, expressive orm -- supports postgresql, mysql and sqlite
http://docs.peewee-orm.com/
MIT License
13 stars 4 forks source link

Columns that dont exists are accessible and return none #13

Open neopunisher opened 7 years ago

neopunisher commented 7 years ago
('SELECT COUNT(%s) FROM post_published_to AS ppt1 LIMIT 1', [1])
<models.post.PostPublishedTo object at 0x7f29531edd10>
>>> PostPublishedTo.ALL.group_by(PostPublishedTo.post).select(PostPublishedTo.post_id,pw.fn.COUNT(1)).first()
('SELECT COUNT(%s) FROM post_published_to AS ppt1 GROUP BY ppt1.post_id LIMIT 1', [1])
<models.post.PostPublishedTo object at 0x7f29531ed990>
>>> PostPublishedTo.post_id is None
True
>>> PostPublishedTo.post is None
False