In this post I'd like to share some techniques for querying the top item by group using the Peewee ORM. For example,. List the most recent tweet by each of my followers. List the highest severity bug for each of my open source projects. List the latest story in each section of a news site.
Well the use case I had to cover I needed to not care about the data models and needed an ORM that was willing to let me tell it what to do. I actually looked into PeeWee first because I liked what I saw, but I found that PeeWee was akin to Ruby's ActiveRecord where it already has an expectation of knowing about your data models beforehand in order to do its magic. I had a similar use case for a Ruby project sometime back and used a toolkit called Sequel that is much like Dataset.
Add a comment...