Lazy queryset eval for Pickle #83

merged 3 commits into from May 12, 2014
Commits on Mar 12, 2014
  1. @felliott
  2. @felliott

    fix simple queries tests to match Mongo semantics

    felliott committed Mar 12, 2014
     * The Pickle and Mongo backends disagreed on how .sort(), .limit(), and
       .offset() work together.  The tests were originally written to match
       the Pickle semantics, but it has been decided that going forwards,
       the Mongo semantics will hold sway.  Summary:
       * sort(), offset(), and limit() are now setters.  Successive calls to
         a function will overwrite the previous value.  No evaluation will
         be performed by these functions.  The underlying data will only be
         updated when __iter__, __getitem__, or __len__ is called.  E.g.
         Foo.find().limit(10).limit(15) will return 15 items.
       * The constraints are always processed in the same order regardless
         of the order in which they are declared.  sort()s are run first,
         then offset(), then limit(). E.g.
         Foo.find().limit(10).offset(5).sort("_id") will sort first, then
         apply the offset, then limit the returned results to 10.
  3. @felliott