You are right, this is only true of Django queries :) On Jan 23, 6:33 pm, djidjadji <djidja...@gmail.com> wrote: > This is not true. > They are equivalent. They modify the query IN-PLACE. They do not > return a new one. > All the db.Query methods return self. You can choose to chain them all > in one line or in separate lines. > No need to assign to the items variable after the create call [ Item.all() ]. > > 2011/1/23 ClaudeVedovini<cla...@vedovini.net>: > > > > > > > > > I also noticed that your code to retrieve the records from the DB is > > wrong, this won't work as you expect: > > > items = Item.all() > > items.filter("type =", merchandise_type) > > items.order("-points") > > > because filter and order methods do not modify the query, they return > > a new one, so your code be: > > > items = Item.all() > > items = items.filter("type =", merchandise_type) > > items = items.order("-points") > > > or the shorter > > > items = Item.all().filter("type =", merchandise_type).order("-points")
-- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.