Am 14.04.2010 08:24 schrieb jo:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: can't compare datetime.date to NoneType

Contrary to other Python 2 types, you can't compare dates with None values or other objects of a different type (i.e. date behaves already as all objects do in Python 3).

One solution is to create your own date class which will treat None as -infinity or +infinity. Or just use ISO-formatted strings.

If your data is coming from a database, you should also check whether you can do the sorting via SQL in the database. The paginate decorator tries to do that with query results if you use it properly.

The paginate decorator for 1.x is pretty well documented:
http://docs.turbogears.org/1.0/PaginateDecorator

-- Christoph

--
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.

Reply via email to