[django_tables2] Expected table or queryset, not 'str'.

1,721 views
Skip to first unread message

Tomas Pelka

unread,
Apr 9, 2013, 3:06:57 PM4/9/13
to django...@googlegroups.com

ValueError at /plyn

Expected table or queryset, not 'str'.
Request Method:GET
Request URL:http://127.0.0.1:8000/plyn
Django Version:1.5
Exception Type:ValueError
Exception Value:
Expected table or queryset, not 'str'.
Exception Location:/usr/lib/python2.7/site-packages/django_tables2-0.13.0-py2.7.egg/django_tables2/templatetags/django_tables2.py in render, line 176
Python Executable:/usr/bin/python
Python Version:2.7.3
Python Path:
['/home/tpelka/workspace/energie/wsgi/energie',
 '/usr/lib/python2.7/site-packages/ropevim-0.4-py2.7.egg',
 '/usr/lib/python2.7/site-packages/ropemode-0.2-py2.7.egg',
 '/usr/lib/python2.7/site-packages/rope-0.9.4-py2.7.egg',
 '/usr/lib/python2.7/site-packages/mozmill-1.5.20-py2.7.egg',
 '/usr/lib/python2.7/site-packages/ManifestDestiny-0.2.2-py2.7.egg',
 '/usr/lib/python2.7/site-packages/mozrunner-2.5.14-py2.7.egg',
 '/usr/lib/python2.7/site-packages/jsbridge-2.4.16-py2.7.egg',
 '/usr/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg',
 '/usr/lib/python2.7/site-packages/django_tables2-0.13.0-py2.7.egg',
 '/usr/share/qa-tools/python-modules',
 '/usr/lib64/python27.zip',
 '/usr/lib64/python2.7',
 '/usr/lib64/python2.7/plat-linux2',
 '/usr/lib64/python2.7/lib-tk',
 '/usr/lib64/python2.7/lib-old',
 '/usr/lib64/python2.7/lib-dynload',
 '/usr/lib64/python2.7/site-packages',
 '/usr/lib64/python2.7/site-packages/gst-0.10',
 '/usr/lib64/python2.7/site-packages/gtk-2.0',
 '/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode',
 '/usr/lib/python2.7/site-packages',
 '/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
Server time:út, 9 Dub 2013 20:55:56 +0200


Any clue why this error happen. Sources attached.
plyn.html
base.html
tables.py
models.py
views.py

Tom Evans

unread,
Apr 10, 2013, 5:08:35 AM4/10/13
to django...@googlegroups.com
On Tue, Apr 9, 2013 at 8:06 PM, Tomas Pelka <tomp...@gmail.com> wrote:
>
> ValueError at /plyn
>
> Expected table or queryset, not 'str'.
>
> Request Method:GET
> Request URL:http://127.0.0.1:8000/plyn
> Django Version:1.5
> Exception Type:ValueError
> Exception Value:
>
> Expected table or queryset, not 'str'.
>

You're using an old version of django-tables2 that doesn't support the
version of Django you are using.

Cheers

Tom

Tomas Pelka

unread,
Apr 10, 2013, 5:19:26 AM4/10/13
to django...@googlegroups.com, teva...@googlemail.com
Damn, what is the correct version or other plugin to display nice tables in Django?

Thanks
Tom

Dne středa, 10. dubna 2013 11:08:35 UTC+2 Tom Evans napsal(a):

Binith Babu

unread,
Apr 26, 2013, 9:30:16 AM4/26/13
to django...@googlegroups.com
I got the same error today, anybody know a solution?

Tom Evans

unread,
Apr 26, 2013, 9:53:06 AM4/26/13
to django...@googlegroups.com
On Fri, Apr 26, 2013 at 2:30 PM, Binith Babu <bin...@gmail.com> wrote:
>
> I got the same error today, anybody know a solution?
>

Apart from the solution I already posted to the list in this thread?

Cheers

Tom

Binith Babu

unread,
Apr 26, 2013, 10:25:35 AM4/26/13
to django...@googlegroups.com, teva...@googlemail.com
I am sorry I coud not find a solution in this thread

Did you mean I am using an older version of django tables2 ?
In that case I am not, I am using the latest version installed with pip.
May be its my mistake, I am still trying to figure whether I am doing something wrong.
WIll post back if I find something.

Thanks
binith

Binith Babu

unread,
Apr 29, 2013, 3:21:29 AM4/29/13
to django...@googlegroups.com, teva...@googlemail.com
You were correct, it was indeed a version problem.
I was using latest django-tables2 in my new python virtual env and I had an older version (of django-tables2) installed as default, and the PYTHONPATH environment variable was pointing to the older version.

Problem solved, thanks for the time

thanks
-binith

Leutrim Osmani

unread,
Oct 28, 2015, 9:17:28 AM10/28/15
to Django users, teva...@googlemail.com
Can you please tell me how did you fixed this error ?

Collin Anderson

unread,
Nov 5, 2015, 10:25:45 AM11/5/15
to Django users, teva...@googlemail.com
Hi,

Do you to post your traceback if you're still getting this error?

Thanks,
Collin
Reply all
Reply to author
Forward
0 new messages