django_tables2: TemplateSyntaxError: Caught ValueError while rendering: Expected table or queryset
Hi everyone. I'm getting an error when I {% render_table table %} -- it seems that my calls to tables I define (i.e. table = CourseTable() are not actually returning Table objects. I've posted more on StackOverflow for the sake of exposure and accessibility to people who may run into this problem in the future. http://stackoverflow.com/questions/20843067/django-tables2-templatesyntaxerror-caught-valueerror-while-rendering-expected Would very much appreciate your thoughts! Happy New Year's. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c685004a-6628-4f31-8355-052e93077e4b%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: rendering a table
Hi Hugo, Your template code, does it actually contains and ? Like below? {% for row in rows %} {% for value in row %} {{ value }} {% endfor %} {% endfor %} Then, what does rows look like? Can you post your output please? To get this output, for example, use "print rows" before you render the template, and post the result here. That would help! Wim On Sep 27, 6:37 pm, jhugowrote: > What i want to display as a table is the fallowing: > > rows---row--- row ---row > | | | > number1 name1 date1 > number2 name2 date2 > number3 name3 date3 > > Now when django renders my template i get this: > > number1 name1 date1 > number1 name1 date1 number2 name2 date2 > number1 name1 date1 number2 name2 date2 number3 name3 date3 > > Is this better? I am not getting why i am getting this behavior? > > On Sep 27, 5:48 am, Léon Dignòn wrote: > > > Could you post your list and your output please? > > > On Sep 27, 2:04 am, jhugo wrote: > > > > Hi, > > > > I want to render a table using a list of list. What I do is create a > > > list for the rows and append another list for the columns. I use two > > > fors in my template to render the table and as the first loop progress > > > the second always renders the values from the beginning and a i end up > > > having my rows incrementing in length. Why is this? > > > > this is what i have: > > > > {% for row in rows %} > > > > > > {% for value in row %} > > > {{ value }} > > > {% endfor %} > > > > > > {% endfor %} > > > > Thanks, > > > > -- Hugo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: rendering a table
What i want to display as a table is the fallowing: rows---row--- row ---row | | | number1 name1 date1 number2 name2 date2 number3 name3 date3 Now when django renders my template i get this: number1 name1 date1 number1 name1 date1 number2 name2 date2 number1 name1 date1 number2 name2 date2 number3 name3 date3 Is this better? I am not getting why i am getting this behavior? On Sep 27, 5:48 am, Léon Dignònwrote: > Could you post your list and your output please? > > On Sep 27, 2:04 am, jhugo wrote: > > > Hi, > > > I want to render a table using a list of list. What I do is create a > > list for the rows and append another list for the columns. I use two > > fors in my template to render the table and as the first loop progress > > the second always renders the values from the beginning and a i end up > > having my rows incrementing in length. Why is this? > > > this is what i have: > > > {% for row in rows %} > > > > {% for value in row %} > > {{ value }} > > {% endfor %} > > > > {% endfor %} > > > Thanks, > > > -- Hugo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: rendering a table
Could you post your list and your output please? On Sep 27, 2:04 am, jhugowrote: > Hi, > > I want to render a table using a list of list. What I do is create a > list for the rows and append another list for the columns. I use two > fors in my template to render the table and as the first loop progress > the second always renders the values from the beginning and a i end up > having my rows incrementing in length. Why is this? > > this is what i have: > > {% for row in rows %} > > {% for value in row %} > {{ value }} > {% endfor %} > > {% endfor %} > > Thanks, > > -- Hugo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
rendering a table
Hi, I want to render a table using a list of list. What I do is create a list for the rows and append another list for the columns. I use two fors in my template to render the table and as the first loop progress the second always renders the values from the beginning and a i end up having my rows incrementing in length. Why is this? this is what i have: {% for row in rows %} {% for value in row %} {{ value }} {% endfor %} {% endfor %} Thanks, -- Hugo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: TemplateSyntaxError at /admin/ Caught an exception while rendering: (1146, "Table 'winzees.django_admin_log' doesn't exist")
Yes you were right, silly me! Thanks eheh On 28 Aug, 14:12, Karen Tracey <kmtra...@gmail.com> wrote: > On Aug 28, 7:57 am, "s.molinari" <s.molinar...@googlemail.com> wrote: > > > Hiya! > > I tried to access the django admin page and I got that error. How do i > > fix it? I am stuck... > > I am new at using django as well... just to let you know ;) > > > [snip] > > Exception Type: TemplateSyntaxError at /admin/ > > Exception Value: Caught an exception while rendering: (1146, "Table > > 'winzees.django_admin_log' doesn't exist") > > One of the tables needed for admin does not exist. It appears you did > not run python manage.py syncdb after adding admin to your > INSTALLED_APPS. You need to run syncdb after adding apps so that > their tables will be created. > > Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: TemplateSyntaxError at /admin/ Caught an exception while rendering: (1146, "Table 'winzees.django_admin_log' doesn't exist")
On Aug 28, 7:57 am, "s.molinari" <s.molinar...@googlemail.com> wrote: > Hiya! > I tried to access the django admin page and I got that error. How do i > fix it? I am stuck... > I am new at using django as well... just to let you know ;) > > [snip] > Exception Type: TemplateSyntaxError at /admin/ > Exception Value: Caught an exception while rendering: (1146, "Table > 'winzees.django_admin_log' doesn't exist") One of the tables needed for admin does not exist. It appears you did not run python manage.py syncdb after adding admin to your INSTALLED_APPS. You need to run syncdb after adding apps so that their tables will be created. Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
TemplateSyntaxError at /admin/ Caught an exception while rendering: (1146, "Table 'winzees.django_admin_log' doesn't exist")
Hiya! I tried to access the django admin page and I got that error. How do i fix it? I am stuck... I am new at using django as well... just to let you know ;) Environment: Request Method: GET Request URL: http://127.0.0.1:8000/admin/ Django Version: 1.1 Python Version: 2.6.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'winzees.competitions', 'winzees.items', 'winzees.members', 'winzees.favourites', 'winzees.blog', 'winzees.advertisements', 'winzees.transfers'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware') Template error: In template /usr/local/lib/python2.6/dist-packages/django/contrib/ admin/templates/admin/index.html, error at line 57 Caught an exception while rendering: (1146, "Table 'winzees.django_admin_log' doesn't exist") 47 : 48 : {% endblock %} 49 : 50 : {% block sidebar %} 51 : 52 : 53 : {% trans 'Recent Actions' %} 54 : {% trans 'My Actions' %} 55 : {% load log %} 56 : {% get_admin_log 10 as admin_log for_user user %} 57 : {% if not admin_log %} 58 : {% trans 'None available' %} 59 : {% else %} 60 : 61 : {% for entry in admin_log %} 62 : 63 : {% if entry.is_deletion %} 64 : {{ entry.object_repr }} 65 : {% else %} 66 : {{ entry.object_repr }} 67 : {% endif %} Traceback: File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/ base.py" in get_response 92. response = callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/ sites.py" in wrapper 196. return self.admin_view(view, cacheable)(*args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/ cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/ sites.py" in inner 186. return view(request, *args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/ cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/ sites.py" in index 374. context_instance=context_instance File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/ __init__.py" in render_to_response 20. return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) File "/usr/local/lib/python2.6/dist-packages/django/template/ loader.py" in render_to_string 108. return t.render(context_instance) File "/usr/local/lib/python2.6/dist-packages/django/template/ __init__.py" in render 178. return self.nodelist.render(context) File "/usr/local/lib/python2.6/dist-packages/django/template/ __init__.py" in render 779. bits.append(self.render_node(node, context)) File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node 71. result = node.render(context) File "/usr/local/lib/python2.6/dist-packages/django/template/ loader_tags.py" in render 97. return compiled_parent.render(context) File "/usr/local/lib/python2.6/dist-packages/django/template/ __init__.py" in render 178. return self.nodelist.render(context) File "/usr/local/lib/python2.6/dist-packages/django/template/ __init__.py" in render 779. bits.append(self.render_node(node, context)) File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node 71. result = node.render(context) File "/usr/local/lib/python2.6/dist-packages/django/template/ loader_tags.py" in render 97. return compiled_parent.render(context) File "/usr/local/lib/python2.6/dist-packages/django/template/ __init__.py" in render 178. return self.nodelist.render(context) File "/usr/local/lib/python2.6/dist-packages/django/template/ __init__.py" in render 779. bits.append(self.render_node(node, context)) File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in render_node 71. result = node.render(context) File "/usr/local/lib/python2.6/dist-packages/django/template/ loader_tags.py" in render 24. result = self.nodelist.render(context) File "/