After upgrading to TG-2.2 I noticed the following error (see below) when browsing pages in admin/ controller like: admin/groups/. The error paper only when I am using real-db (PostgreSQL) and does not appear when I am using sqlite.
Any idea how to fix this?
Thanks,
Erni.
Error - <type 'exceptions.TypeError'>: __len__() should return an int URL: http://127.0.0.1/admin/groups/ File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/WebError-0.10 .3-py2.7.egg/weberror/errormiddleware.py', line 162 in __call__ app_iter = self.application(environ, sr_checker) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/TurboGears2-2 .2.0-py2.7.egg/tg/configuration/app_config.py', line 894 in remover return app(environ, start_response) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/repoze.tm2-1. 0-py2.7.egg/repoze/tm/__init__.py', line 24 in __call__ result = self.application(environ, save_status_and_headers) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/repoze.who-2. 0-py2.7.egg/repoze/who/middleware.py', line 87 in __call__ app_iter = app(environ, wrapper.wrap_start_response) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/tw2.core-2.1. 2-py2.7.egg/tw2/core/middleware.py', line 195 in __call__ resp = req.get_response(self.app, catch_exc_info=True) File 'build/bdist.linux-x86_64/egg/webob/request.py', line 1082 in get_response File 'build/bdist.linux-x86_64/egg/webob/request.py', line 1055 in call_application File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/Beaker-1.6.3- py2.7.egg/beaker/middleware.py', line 73 in __call__ return self.app(environ, start_response) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/Beaker-1.6.3- py2.7.egg/beaker/middleware.py', line 155 in __call__ return self.wrap_app(environ, session_start_response) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/Routes-1.13-p y2.7.egg/routes/middleware.py', line 131 in __call__ response = self.app(environ, start_response) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/Pylons-1.0-py 2.7.egg/pylons/wsgiapp.py', line 107 in __call__ response = self.dispatch(controller, environ, start_response) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/Pylons-1.0-py 2.7.egg/pylons/wsgiapp.py', line 312 in dispatch return controller(environ, start_response) File '/home/erni/my_example/my_example.front/my_example/lib/base.py', line 31 in __call__ return TGController.__call__(self, environ, start_response) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/Pylons-1.0-py 2.7.egg/pylons/controllers/core.py', line 211 in __call__ response = self._dispatch_call() File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/Pylons-1.0-py 2.7.egg/pylons/controllers/core.py', line 162 in _dispatch_call response = self._inspect_call(func) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/Pylons-1.0-py 2.7.egg/pylons/controllers/core.py', line 105 in _inspect_call result = self._perform_call(func, args) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/TurboGears2-2 .2.0-py2.7.egg/tg/controllers/dispatcher.py', line 127 in _perform_call r = self._call(func, params, remainder=remainder) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/TurboGears2-2 .2.0-py2.7.egg/tg/controllers/decoratedcontroller.py', line 143 in _call tg_decoration.run_hooks('before_render', remainder, params, output) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/TurboGears2-2 .2.0-py2.7.egg/tg/decorators.py', line 75 in run_hooks func(*l, **kw) File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/TurboGears2-2 .2.0-py2.7.egg/tg/decorators.py', line 582 in before_render paginator.paginate_items_per_page, controller='/') File '/home/erni/prefix/TurboGears-2.2/lib/python2.7/site-packages/WebHelpers-1. 3-py2.7.egg/webhelpers/paginate.py', line 413 in __init__ self.item_count = len(self.collection) TypeError: __len__() should return an int
Perhaps you can share your shema/models?, I have a related problem
that is triggered by a specific model, not sure what it is, seems like
datetime fields, but I will try to go deep into this afternoon and
would be helpful to check your problems at once (as they seem
related).
> To post to this group, send email to turbogears@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
This seems to be a problem going back to tgext.crud, seems like the
special paginator that tgext.crud uses does not follow the __len__
protocol strictly and python raises this error.
Normally the length of the list or collection is given as an int, but
I imagine psycopg2 returns a long somewhere and the class
SmartPaginationCollection does not check this and just uses it as is.
I will fill a bug later on github, I already have a working patch but
perhaps this needs some fixing deeper on.
Regards,
Carlos Daniel Ruvalcaba Valenzuela
On Mon, Nov 5, 2012 at 11:48 AM, Carlos Daniel Ruvalcaba Valenzuela
<clsdan...@gmail.com> wrote:
> Perhaps you can share your shema/models?, I have a related problem
> that is triggered by a specific model, not sure what it is, seems like
> datetime fields, but I will try to go deep into this afternoon and
> would be helpful to check your problems at once (as they seem
> related).
> Regards,
> Carlos Daniel Ruvalcaba Valenzuela
> On Mon, Nov 5, 2012 at 9:09 AM, Fernando González
> <fernando.gonzal...@gmail.com> wrote:
>>> Hi, same problem here.
>> To post to this group, send email to turbogears@googlegroups.com.
>> To unsubscribe from this group, send email to
>> turbogears+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/turbogears?hl=en.
clsdan...@gmail.com> wrote:
> This seems to be a problem going back to tgext.crud, seems like the
> special paginator that tgext.crud uses does not follow the __len__
> protocol strictly and python raises this error.
> Normally the length of the list or collection is given as an int, but
> I imagine psycopg2 returns a long somewhere and the class
> SmartPaginationCollection does not check this and just uses it as is.
> I will fill a bug later on github, I already have a working patch but
> perhaps this needs some fixing deeper on.
> Regards,
> Carlos Daniel Ruvalcaba Valenzuela
> On Mon, Nov 5, 2012 at 11:48 AM, Carlos Daniel Ruvalcaba Valenzuela
> <clsdan...@gmail.com> wrote:
> > Perhaps you can share your shema/models?, I have a related problem
> > that is triggered by a specific model, not sure what it is, seems like
> > datetime fields, but I will try to go deep into this afternoon and
> > would be helpful to check your problems at once (as they seem
> > related).
> > Regards,
> > Carlos Daniel Ruvalcaba Valenzuela
> > On Mon, Nov 5, 2012 at 9:09 AM, Fernando González
> > <fernando.gonzal...@gmail.com> wrote:
> >>> Hi, same problem here.
> >> To post to this group, send email to turbogears@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> turbogears+unsubscribe@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/turbogears?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to turbogears@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
> On Mon, Nov 5, 2012 at 2:34 PM, Carlos Daniel Ruvalcaba Valenzuela <
> clsdan...@gmail.com> wrote:
>> This seems to be a problem going back to tgext.crud, seems like the
>> special paginator that tgext.crud uses does not follow the __len__
>> protocol strictly and python raises this error.
>> Normally the length of the list or collection is given as an int, but
>> I imagine psycopg2 returns a long somewhere and the class
>> SmartPaginationCollection does not check this and just uses it as is.
>> I will fill a bug later on github, I already have a working patch but
>> perhaps this needs some fixing deeper on.
>> Regards,
>> Carlos Daniel Ruvalcaba Valenzuela
>> On Mon, Nov 5, 2012 at 11:48 AM, Carlos Daniel Ruvalcaba Valenzuela
>> <clsdan...@gmail.com> wrote:
>> > Perhaps you can share your shema/models?, I have a related problem
>> > that is triggered by a specific model, not sure what it is, seems like
>> > datetime fields, but I will try to go deep into this afternoon and
>> > would be helpful to check your problems at once (as they seem
>> > related).
>> > Regards,
>> > Carlos Daniel Ruvalcaba Valenzuela
>> > On Mon, Nov 5, 2012 at 9:09 AM, Fernando González
>> > <fernando.gonzal...@gmail.com> wrote:
>> >>> Hi, same problem here.
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "TurboGears" group.
>> >> To view this discussion on the web visit
>> >> https://groups.google.com/d/msg/turbogears/-/nQumyCfd7r4J.
>> >> To post to this group, send email to turbogears@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> turbogears+unsubscribe@googlegroups.com.
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/turbogears?hl=en.
>> --
>> You received this message because you are subscribed to the Google Groups
>> "TurboGears" group.
>> To post to this group, send email to turbogears@googlegroups.com.
>> To unsubscribe from this group, send email to
>> turbogears+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/turbogears?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to turbogears@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
>> On Mon, Nov 5, 2012 at 2:34 PM, Carlos Daniel Ruvalcaba Valenzuela <
>> clsdan...@gmail.com> wrote:
>>> This seems to be a problem going back to tgext.crud, seems like the
>>> special paginator that tgext.crud uses does not follow the __len__
>>> protocol strictly and python raises this error.
>>> Normally the length of the list or collection is given as an int, but
>>> I imagine psycopg2 returns a long somewhere and the class
>>> SmartPaginationCollection does not check this and just uses it as is.
>>> I will fill a bug later on github, I already have a working patch but
>>> perhaps this needs some fixing deeper on.
>>> Regards,
>>> Carlos Daniel Ruvalcaba Valenzuela
>>> On Mon, Nov 5, 2012 at 11:48 AM, Carlos Daniel Ruvalcaba Valenzuela
>>> <clsdan...@gmail.com> wrote:
>>> > Perhaps you can share your shema/models?, I have a related problem
>>> > that is triggered by a specific model, not sure what it is, seems like
>>> > datetime fields, but I will try to go deep into this afternoon and
>>> > would be helpful to check your problems at once (as they seem
>>> > related).
>>> > Regards,
>>> > Carlos Daniel Ruvalcaba Valenzuela
>>> > On Mon, Nov 5, 2012 at 9:09 AM, Fernando González
>>> > <fernando.gonzal...@gmail.com> wrote:
>>> >>> Hi, same problem here.
>>> >> --
>>> >> You received this message because you are subscribed to the Google
>>> Groups
>>> >> "TurboGears" group.
>>> >> To view this discussion on the web visit
>>> >> https://groups.google.com/d/msg/turbogears/-/nQumyCfd7r4J.
>>> >> To post to this group, send email to turbogears@googlegroups.com.
>>> >> To unsubscribe from this group, send email to
>>> >> turbogears+unsubscribe@googlegroups.com.
>>> >> For more options, visit this group at
>>> >> http://groups.google.com/group/turbogears?hl=en.
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "TurboGears" group.
>>> To post to this group, send email to turbogears@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> turbogears+unsubscribe@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/turbogears?hl=en.
>> --
>> You received this message because you are subscribed to the Google Groups
>> "TurboGears" group.
>> To post to this group, send email to turbogears@googlegroups.com.
>> To unsubscribe from this group, send email to
>> turbogears+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/turbogears?hl=en.
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to turbogears@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.