jo wrote:
jo wrote:
jo wrote:
Hi all,
I'm trying upgrade to 1.1.1 but I have problems with paginate
decorator.
here the message:
Module sc.templates.DataGrid:57 in _pull
AttributeError: 'list' object has no attribute 'get' Error location
in template file 'edit.kid' between line 26, column 8 and line 27,
column 4: <span py:replace="grid(grid_params)"/>
What can I do to avoid this?
thank you
j
The error is on this line
tg.paginate.ordering.get(tg.paginate.order)
seems tg.paginate.ordering now is a list instead of a dictionary.
j
Here another problem with paginate,
seems it can't sort by a datetime column if it contains None values...
Sorry for this ugly feedback :-[
I see the error is in line 531 of
../TurboGears-1.1.1-py2.6.egg/turbogears/paginate.py
530 key = lambda row: [key(row) for key in keys]
531 data.sort(key=key, reverse=reverse)
532 else:
533 log.debug("paginate: sorting in memory not allowed")
534 return data
I tried it with python2.6.5...
$ python
Python 2.6.5 (r265:79063, Apr 9 2010, 17:07:58)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import datetime
>>> data=[]
>>> data.append(datetime.date.today())
>>> data.append(None)
>>> data.sort()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: can't compare datetime.date to NoneType
j
--
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en.