{django-tables} Caught NameError while rendering: global name 'name' is not defined.

82 views
Skip to first unread message

Kayode Odeyemi

unread,
Aug 8, 2011, 7:34:00 AM8/8/11
to Django Apps, django...@googlegroups.com
Hello,

Please why am I get the following error:

Caught NameError while rendering: global name 'name' is not defined.

Initially I did not receive this sort of error, it just surfaced all
off a sudden. I restored my app to the state where everything worked
and I'm still getting the same error.

Full stack trace:

Caught NameError while rendering: global name 'name' is not defined
Request Method: GET
Request URL: http://site/reports
Django Version: 1.3
Exception Type: TemplateSyntaxError
Exception Value:
Caught NameError while rendering: global name 'name' is not defined
Exception Location: build\bdist.win32\egg\django_tables\models.py in
_default_render, line 73
Python Executable: C:\path\apache\apache2.2.10\bin\httpd.exe
Python Version: 2.7.1

In my template file:

{% load humanize %}
{% load tables %}
{% load pagination_tags %}
{% autopaginate rows 2 %}

{% for row in table.rows %}
<tr class="{% cycle 'odd' 'even' %}">
{% for value in row %}
<td class="table-data">{{ value }}<td>
{% endfor %}
</tr>
{% endfor %}

When i remove the above code from my template the error goes away but
table rows are not displayed.

Any suggestions please.

Thanks

Kayode Odeyemi

unread,
Aug 10, 2011, 5:57:29 AM8/10/11
to Django Apps, django...@googlegroups.com
Please I'm still stuck on this.


I'll appreciate some pointers to the root cause of this.

Thanks


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

Michael Elsdörfer

unread,
Aug 10, 2011, 3:23:19 PM8/10/11
to Django Apps
This is probably this bug: https://github.com/miracle2k/django-tables2/issues/5

It should be fixed in the latest source version on Github.

Generally, I recommend you migrate to django-tables2 in the middle-
term:

http://pypi.python.org/pypi/django-tables2/0.7.3

On Aug 10, 11:57 am, Kayode Odeyemi <drey...@gmail.com> wrote:
> Please I'm still stuck on this.
>
> I have posted it to SO athttp://stackoverflow.com/questions/6993387/django-tables-caught-namee....
Reply all
Reply to author
Forward
0 new messages