Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating README and bumping to 0.3.0

  • Loading branch information...
commit 510cca7fe6c50431ebc9c05ec623e93f823c1cc4 1 parent 9a79aca
Charles Leifer authored
Showing with 24 additions and 10 deletions.
  1. +1 −0  MANIFEST.in
  2. +22 −9 README.rst
  3. +1 −1  setup.py
1  MANIFEST.in
View
@@ -2,3 +2,4 @@ include LICENSE
include README.rst
include TODO.rst
recursive-include example *
+recursive-include docs *
31 README.rst
View
@@ -1,21 +1,22 @@
peewee
======
-a small orm
+* a small orm
+* written in python
+* provides a lightweight querying interface over sql
+* uses sql concepts when querying, like joins and where clauses
-written to provide a lightweight querying interface over sql
-
-uses sql concepts when querying, like joins, group by, having, etc.
-
-pagination is handled for you automatically
Examples::
# a simple query selecting a user
- User.select().where(username='charles')
+ User.get(username='charles')
+
+ # get the staff and super users
+ editors = User.select().where(Q(is_staff=True) | Q(is_superuser=True))
- # get the tweets by a user named charles and order the newest to oldest
- Tweet.select().order_by(('pub_date', 'desc')).join(User).where(username='charles')
+ # get tweets by editors
+ Tweet.select().where(user__in=editors)
# how many active users are there?
User.select().where(active=True).count()
@@ -30,6 +31,18 @@ Examples::
}).group_by('id').join(Tweet).order_by(('num_tweets', 'desc'))
+Why?
+----
+
+peewee began when I was working on a small app in flask and found myself writing
+lots of queries and wanting a very simple abstraction on top of the sql. I had
+so much fun working on it that I kept adding features. My goal has always been,
+though, to keep the implementation incredibly simple. I've made a couple dives
+into django's orm but have never come away with a deep understanding of its
+implementation. peewee is small enough that its my hope anyone with an interest
+in orms will be able to understand the code without too much trouble.
+
+
model definitions and schema creation
-------------------------------------
2  setup.py
View
@@ -7,7 +7,7 @@
setup(
name='peewee',
- version="0.2.2",
+ version="0.3.0",
description='a little orm',
long_description=readme,
author='Charles Leifer',
Please sign in to comment.
Something went wrong with that request. Please try again.