Hello-
On Friday afternoon I migrated a project from sqlite to postgres.
Everything went smoothly and I was able to go home for the weekend and
be happy. Yay.
This morning I was informed that the sort order is different. I have a
DateField for a due date that is set as not required, however leaving
it blank treats it as ASAP. I'm assuming this is a result of the
different sort orders between sqlite and postgres. I got used to
sqlite sorting it like: "None, Oct, Dec, etc." but now I am getting
"Oct, Dec, etc., None".

Here are the options I'd rather not do:
-Go back to sqlite
-set the default as some date years ago and override the display value
in templates (I already use this method to make a None show as "ASAP")
i.e. {% if item.due_date == '1999-1-1' %}ASAP{% else %}
{{ item.due_date }}{% endif %}
-add another field to the model, a boolean field for  ASAP, set it to
true if the due date is blank and sort by that first (this may
actually be a decent option)

I'm hoping there is a setting in postgres that can be changed for the
sort priority of null.
Is this any easy way to solve this problem before I start reworking
all the code?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to