On 3/2/12 10:55 AM, Paul McNett wrote:
> When confronted by things like this, I like to reduce them down with as few
> variables
> as possible, in a single, simple script. Please look at this script and run
> it, which
> seems to prove that there isn't anything obviously wrong at the Dabo layer,
> although
> you should tweak the script to better match your situation, like adding the
> second
> table, etc.:
>
> http://paulmcnett.com/test_sqlite_view.py
Oh, hang on... a click on a grid header results in the traceback:
{{{
Traceback (most recent call last):
File "/home/pmcnett/dabo-full/trunk/dabo/ui/uiwx/dGrid.py", line 4161, in
__onWxHeaderMouseLeftUp
self.raiseEvent(dEvents.GridHeaderMouseLeftUp, evt, col=col)
File "/home/pmcnett/dabo-full/trunk/dabo/ui/uiwx/dPemMixin.py", line 1074,
in
raiseEvent
super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, **kwargs)
File "/home/pmcnett/dabo-full/trunk/dabo/lib/eventMixin.py", line 81, in
raiseEvent
bindingFunction(event)
File "/home/pmcnett/dabo-full/trunk/dabo/ui/uiwx/dGrid.py", line 3632, in
_onGridHeaderMouseLeftUp
self.processSort(col)
File "/home/pmcnett/dabo-full/trunk/dabo/ui/uiwx/dGrid.py", line 2894, in
processSort
biz.sort(columnToSort, sortOrder, self.caseSensitiveSorting)
File "/home/pmcnett/dabo-full/trunk/dabo/biz/dBizobj.py", line 1209, in sort
cc.sort(col, ordr, caseSensitive)
File "/home/pmcnett/dabo-full/trunk/dabo/db/dCursorMixin.py", line 593, in
sort
self.__sortRows(newCol, newOrd, caseSensitive)
File "/home/pmcnett/dabo-full/trunk/dabo/db/dCursorMixin.py", line 619, in
__sortRows
self.__unsortedRows.append(row[kf])
KeyError: u'id'
}}}
I messed up writing the script and had the KeyField defined in the bizobj as
"id" and
not "Id". Making that change makes grid sorting work just fine, as well as
probably
everything else that relies on KeyField. I've fixed the test script online:
http://paulmcnett.com/test_sqlite_view.py
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]