TurboGears/tgext.crud — pull request #2 by clsdaniel (2012-11-05 22:24:22+00:00)
Title: Workaround for bug when using SmartPaginationCollection with psycopg2 backend.

When using psycopg2 backend SmartPaginationCollection seems to be passed the total number of pages as a long and uses it as is, when asking the length of the collection the total is returned on the __len__ function, this violates the __len__ protocol which specifies that __len__ may only return an int (when called from len()) causing an exception.

This is a problem that has been reported by at least 2 users on the TG mailing list.