2

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.

1 Answer 1

13

The get function does not have an all attribute. The model manager objects has the all function you're looking for: Form.objects.all()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.