Getting Started – Jan. 21, 2011

Getting setup at the start of the day went pretty well (had already made a fork on github and had review board running on my machine). Getting git setup properly (cloning my fork and setting up a branch to develop on, and just trying it out) took a lot out of the morning. Following setup we moved on to looking at the easy-fix bug list.

Issue 1632:

I was able to reproduce issue 1632 using sqlite as my underlying database, so decided to take it on.

With help from Mike I was able to step through the code base to find approximately where this issue is being caused. I am new to using django however, and the problem seems to be a combination of an order_by() call on a queryset in the djiblets.datagrid.DataGrid class, and whether or not the database being used is case sensitive.

Some checking into the django API revealed that the order_by method’s case sensitivity depends on how the underlying database handles case. So, it looks like the generated SQL does not use ORDER BY LOWER(field) as a default way to handle upper/lower case orderings.

Possible solutions:

– add a new column of the lowercase submitter names so the sort could happen to the lowercase column instead (would only work for the submitter column – also storing redundant data)

Have tried:

– adding a “lower()” call around the submitter field in the sort_list in the precompute_object method in (DataGrid class). I would think that adding this around some of the sort_list items (the strings) would make the order by call use ORDER BY LOWER(string1), LOWER(string2), …

So far this hasn’t worked (have to look into the database to see what field I actually want to use lower on (if that works then a regex could be used to handle all strings that way – assuming we want to sort all strings without case sensitivity)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s