Permalink
Browse files

Merge branch 'unstable/2.0'

Conflicts:
	peewee.py
	tests.py
  • Loading branch information...
2 parents b76f80e + 7af7076 commit 755c899e545f0f34427e69c0a4dd8c869908fd0c @coleifer committed Oct 8, 2012
View
@@ -1,5 +1,6 @@
todo
====
-* investigate fetching the optimal number of results from the cursor
- as opposed to pulling them off one at a time
+* backwards compat, esp places where existing api allows strings
+* stronger input validation?
+* docs
@@ -24,26 +24,26 @@ def create_entry(blog, title, content, pub_date=None):
def list_users(ordered=False):
if ordered:
- sq = User.select().order_by('username')
+ sq = User.select().order_by(User.username.asc())
else:
sq = User.select()
return list(sq)
def list_blogs_select_related():
- qs = Blog.select({Blog: ['*'], User: ['*']}).join(User)
+ qs = Blog.select(Blog, User).join(User)
return list(qs)
def list_blogs_for_user(user):
return list(user.blog_set)
def list_entries_by_user(user):
- return list(Entry.select().join(Blog).where(user=user))
+ return list(Entry.select().join(Blog).where(Blog.user == user))
def get_user_count():
return User.select().count()
def list_entries_subquery(user):
- return list(Entry.select().where(blog__in=Blog.select().where(user=user)))
+ return list(Entry.select().where(Entry.blog << Blog.select().where(Blog.user == user)))
def get_user(username):
return User.get(username=username)
@@ -1,7 +1,7 @@
import peewee
-test_db = peewee.Database(peewee.SqliteAdapter(), 'test_pw.db')
+test_db = peewee.SqliteDatabase('test_pw.db')
class User(peewee.Model):
username = peewee.CharField()
View
@@ -48,9 +48,9 @@
# built documents.
#
# The short X.Y version.
-version = '1.0.0'
+version = '2.0.0'
# The full version, including alpha/beta/rc tags.
-release = '1.0.0'
+release = '2.0.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
View
@@ -10,11 +10,13 @@ peewee
* written in python
* provides a lightweight querying interface over sql
* uses sql concepts when querying, like joins and where clauses
-* support for special extensions like `hstore <http://peewee.readthedocs.org/en/latest/peewee/playhouse.html#postgresql-extensions-hstore-ltree>`_ and `full-text search <http://peewee.readthedocs.org/en/latest/peewee/playhouse.html#full-text-search>`_
+* support for some extensions, like hstore
For flask integration, including an admin interface and RESTful API, check
out `flask-peewee <https://github.com/coleifer/flask-peewee/>`_.
+See notes on :ref:`notes on upgrading and changes from 1.0 <upgrading>`
+
Contents:
---------
@@ -24,6 +26,7 @@ Contents:
peewee/overview
peewee/installation
+ peewee/upgrading
peewee/cookbook
peewee/example
peewee/models
Oops, something went wrong.

0 comments on commit 755c899

Please sign in to comment.