klipstein/dojango — Issue #12: 12 - TypeError when Using URLField with dojango forms 
Author: klipstein
Created: 2011-11-06 12:46:19+00:00
State: open

What steps will reproduce the problem?

1. A Model with a URLField
2. from dojango import forms and use it (class EntityForm(forms.ModelForm))

Got:

Exception Type: TypeError at /entities/
Exception Value: Error when calling the metaclass bases
__init__() got an unexpected keyword argument 'verify_exists'

Been trying to locate and patch for the last hour, no avail. Here's the
full traceback:

Traceback:
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/core/handlers/base.py"
in get_response
82. request.path_info)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/core/urlresolvers.py"
in resolve
183. sub_match = pattern.resolve(new_path)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/core/urlresolvers.py"
in resolve
183. sub_match = pattern.resolve(new_path)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/core/urlresolvers.py"
in resolve
124. return self.callback, args, kwargs
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/core/urlresolvers.py"
in _get_callback
130. self._callback = get_callable(self._callback_str)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/utils/functional.py"
in wrapper
130. result = func(*args)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/core/urlresolvers.py"
in get_callable
57. lookup_view = getattr(__import__(mod_name, {}, {},
['']), func_name)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/entities/views.py"
in <module>
7. from forms import EntityForm
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/entities/forms.py"
in <module>
5. class EntityForm(forms.ModelForm):
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/dojango/forms/models.py"
in __new__
93. return super(ModelFormMetaclass, cls).__new__(cls, name,
bases, attrs)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/forms/models.py"
in __new__
195. opts.exclude, formfield_callback)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/forms/models.py"
in fields_for_model
162. formfield = formfield_callback(f)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/dojango/forms/models.py"
in formfield_function
81. return field.formfield(form_class=field_map[1])
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/db/models/fields/__init__.py"
in formfield
881. return super(URLField, self).formfield(**defaults)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/db/models/fields/__init__.py"
in formfield
418. return super(CharField, self).formfield(**defaults)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/db/models/fields/__init__.py"
in formfield
328. return form_class(**defaults)
File
"/home/meir/devel/pyenv/django-1.0/lib/python2.6/site-packages/django/forms/fields.py"
in __init__
144. super(CharField, self).__init__(*args, **kwargs)

Exception Type: TypeError at /entities/
Exception Value: Error when calling the metaclass bases
__init__() got an unexpected keyword argument 'verify_exists'

Original link: http://code.google.com/p/dojango/issues/detail?id=12