А вот если делать стандартным выводом
urls.py
(r'', list_detail.object_list, main),
view.py
main = {
"queryset" : Page.objects.all(),
"template_name" : "page.html",
}
page.html
{% block content %}
<div class="post">
<div class="entry">
{% for list_detail in object_list %}
<li>{{ list_detail.name }} -> {{ list_detail.id }}</li>
{% endfor %}
</div>
</div>
{% endblock %}
ТО все выводится корректно. Что не так тогда в первом случае? Не пойму. Шаблон тот же
А если так :
def main(request):
query = Page.objects.all()
c = Context({'content': query})
return t.render(c)
то :
TypeError at /
'dict' object is not callable
Request Method: GET
Request URL: http://127.0.0.1:8080/
Exception Type: TypeError
Exception Value:
'dict' object is not callable
Exception Location: /home/antonio/web/newagro/www/agrostok/../agrostok/page/urls.py in <module>, line 11
Python Executable: /usr/bin/python
Python Version: 2.5.4
Python Path: ['/usr/lib/python2.5/site-packages/mptt/', '/usr/lib/python2.5/site-packages/mptt/', '/home/antonio/web/newagro/www/agrostok', '/usr/lib/python2.5/site-packages/MySQL_python-1.2.3c1-py2.5-linux-i686.egg', '/usr/lib/python2.5/site-packages/flup-1.0.1-py2.5.egg', '/home/antonio/web/newagro/www/agrostok', '/usr/lib/ooo-2.1/program', '/usr/lib/python25.zip', '/usr/lib/python2.5/lib-dynload', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/site-packages/gtk-2.0']
Server time: Wed, 30 Dec 2009 05:18:20 -0600