Thanks for the ideas.  To avoid making 2 queries, I ended up
translating None to MAXYEAR when putting objects into the DB, and
untranslating on the way out.

On Jan 7, 11:14 am, Jeff S <[email protected]> wrote:
> As you've probably noticed, entities with None in the ordered property
> normally appear first when sorting is ascending (the default). To put
> these entities at the end of the result set, you could set this
> property to a high value which would ensure it appears at the end. You
> could set this up as something like UNSET_DATE =
> some_date_in_the_very_distant_future :)
>
> If you want to stick with None, you may need to create two queries,
> one which excludes entities with property set to None and another
> which looks only at entities with the property set to None. If you
> don't have enough results from the first query (no None) to fill the
> page, then you would query for additional entities which do have None.
> These are just a couple of ideas.
>
> Happy coding,
>
> Jeff
>
> On Jan 5, 3:35 pm, Devel63 <[email protected]> wrote:
>
> > Is there a standard or easy way to order query results where a "None"
> > value comes last in an ascending index?
>
> > Use case is for a "due_date" property.  Results should be ordered by
> > due date in from earliest to latest, with "None"s coming last.  Post-
> > processing won't work because I'm only fetching a few records, so
> > won't have them all.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to