Reputation: 43
Hi I got this problem when accessing database:
AttributeError at /renderForm/0 'function' object has no attribute 'all' Request Method: GET Request URL: http://127.0.0.1:8000/renderForm/0 Django Version: 1.2.5 Exception Type: AttributeError Exception Value: 'function' object has no attribute 'all' Exception Location: /home/jay/projects/work/newForm/f/apps/main/views.py in createWholeForm, line 16 Python Executable: /home/jay/projects/work/newForm/bin/python Python Version: 2.7.1 Python Path: ['/home/jay/projects/work/newForm/f/apps', '/home/jay/projects/work/newForm/f', '/home/jay/projects/work/newForm/local/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg', '/home/jay/projects/work/newForm/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg', '/home/jay/projects/work/newForm/lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg', '/home/jay/projects/work/newForm/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg', '/home/jay/projects/work/newForm/lib/python2.7', '/home/jay/projects/work/newForm/lib/python2.7/plat-linux2', '/home/jay/projects/work/newForm/lib/python2.7/lib-tk', '/home/jay/projects/work/newForm/lib/python2.7/lib-old', '/home/jay/projects/work/newForm/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/home/jay/projects/work/newForm/local/lib/python2.7/site-packages', '/home/jay/projects/work/newForm/lib/python2.7/site-packages'] Server time: Fri, 20 Jan 2012 18:52:31 -0600
when I try to do this in django:
form = Form.objects.get.all()
Please help me.
Upvotes: 2
Views: 8095
Reputation: 118488
The get
function does not have an all
attribute. The model manager objects
has the all
function you're looking for: Form.objects.all()
Upvotes: 13