Updated .only() behaviour - now like exclude it is chainable (#202)

This commit is contained in:
Ross Lawley
2013-04-23 14:06:29 +00:00
parent 81c7007f80
commit e2f3406e89
5 changed files with 73 additions and 25 deletions

View File

@@ -4,6 +4,7 @@ Changelog
Changes in 0.8.X
================
- Updated .only() behaviour - now like exclude it is chainable (#202)
- Added with_limit_and_skip support to count() (#235)
- Removed __len__ from queryset (#247)
- Objects queryset manager now inherited (#256)

View File

@@ -114,6 +114,21 @@ explicit `queryset.count()` to update::
# New code
Animal.objects(type="mammal").count())
.only() now inline with .exclude()
----------------------------------
The behaviour of `.only()` was highly ambious, now it works in the mirror fashion
to `.exclude()`. Chaining `.only()` calls will increase the fields required::
# Old code
Animal.objects().only(['type', 'name']).only('name', 'order') # Would have returned just `name`
# New code
Animal.objects().only('name')
Animal.objects().only(['name']).only('order') # Would return `name` and `order`
Client
======
PyMongo 2.4 came with a new connection client; MongoClient_ and started the