Code

Opened 6 years ago

Closed 6 years ago

#6225 closed (invalid)

do not find attribute get

Reported by: Rafael CDB Owned by: nobody
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Request Method: GET
Request URL: http://127.0.0.1:8000/teste/
Exception Type: AttributeError
Exception Value: 'Pessoas' object has no attribute 'get'
Exception Location: C:\Python25\lib\site-packages\django\newforms\widgets.py in value_from_datadict, line 65
Python Executable: C:\Python25\python.exe
Python Version: 2.5.1
Python Path: ['C:
Python
django
tutorial', 'C:
WINDOWS
system32
python25.zip', 'C:
Python25
DLLs', 'C:
Python25
lib',
'C:
Python25
lib
plat-win', 'C:
Python25
lib
lib-tk', 'C:
Python25', 'C:
Python25
lib
site-packages', 'C:
Python25
lib
site-packages
PIL', 'C:
Python25
lib
site-packages
gtk-2.0']

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/teste/
Django Version: 0.97-pre-SVN-unknown
Python Version: 2.5.1
Installed Applications:
['django.contrib.auth',

'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'tutorial.tuto1',
'tutorial.teste1']

Installed Middleware:
('django.middleware.common.CommonMiddleware',

'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware')

Traceback:
File "C:\Python25\Lib\site-packages\django\core\handlers\base.py" in get_response

  1. response = callback(request, *callback_args, callback_kwargs)

File "C:\Python\django\tutorial\..\tutorial\teste1\views.py" in index

  1. return render_to_response('pessoas.html',{'form':f.as_table()})

File "C:\Python25\Lib\site-packages\django\newforms\forms.py" in as_table

  1. return self._html_output(u'<tr><th>%(label)s</th><td>%(errors)s%(field)s%(help_text)s</td></tr>', u'<tr><td colspan="2">%s</td></tr>', '</td></tr>', u'<br />%s', False)

File "C:\Python25\Lib\site-packages\django\newforms\forms.py" in _html_output

  1. top_errors = self.non_field_errors() # Errors that should be displayed above all fields.

File "C:\Python25\Lib\site-packages\django\newforms\forms.py" in non_field_errors

  1. return self.errors.get(NON_FIELD_ERRORS, self.error_class())

File "C:\Python25\Lib\site-packages\django\newforms\forms.py" in _get_errors

  1. self.full_clean()

File "C:\Python25\Lib\site-packages\django\newforms\forms.py" in full_clean

  1. value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))

File "C:\Python25\lib\site-packages\django\newforms\widgets.py" in value_from_datadict

  1. return data.get(name, None)

Exception Type: AttributeError at /teste/
Exception Value: 'Pessoas' object has no attribute 'get'

Attachments (0)

Change History (1)

comment:1 Changed 6 years ago by gwilson

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Please use the django-users mailing list or the django IRC channel for help. It's impossible to tell if this is a bug or not since you do not show the data you are passing to the form object.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.