zbyte64/django-dockit — pull request #3 by msabramo (2012-05-08 19:12:54+00:00)
Title: Fix test environment

These are changes that I had to make in order to be able to successfully run `python manage.py runserver` in the test_environment directory.

With these changes, I was able to add publishers and see them in MongoDB, but I got an error when trying to add a book:

```
TypeError at /admin/books/book/add/
Error when calling the metaclass bases
__init__() takes at least 2 arguments (4 given)

Traceback:
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/admin/documentadmin.py" in wrapper
386. return self.as_view(view, cacheable)(*args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
93. response = view_func(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
79. response = view_func(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
197. return view(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/views/generic/base.py" in view
47. return self.dispatch(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/admin/views.py" in dispatch
616. return admin.get_create_view(object=self.object)(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
93. response = view_func(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
79. response = view_func(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
197. return view(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/views/generic/base.py" in view
47. return self.dispatch(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/admin/views.py" in dispatch
691. return super(CreateView, self).dispatch(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
68. return handler(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/views/edit.py" in get
75. return super(BaseCreateView, self).get(request, *args, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/django-dockit.venv/lib/python2.7/site-packages/django/views/generic/edit.py" in get
130. form_class = self.get_form_class()
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/admin/views.py" in get_form_class
202. return self._generate_form_class()
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/admin/views.py" in _generate_form_class
356. class CustomDocumentForm(form_cls):
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/forms/forms.py" in __new__
204. opts.exclude, form_field_callback=opts.form_field_callback,)
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/forms/forms.py" in fields_for_document
159. field = form_field_callback(prop, type(field), **defaults)
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/admin/views.py" in formfield_for_field
342. return self.admin.formfield_for_field(prop, field, self, **kwargs)
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/admin/documentadmin.py" in formfield_for_field
273. subfield = self.formfield_for_field(prop, type(subfield_kwargs.pop('subfield')), view, **subfield_kwargs)
File "/Users/marca/dev/git-repos/django-dockit/test_environment/dockit/admin/documentadmin.py" in formfield_for_field
280. return field(**kwargs)

Exception Type: TypeError at /admin/books/book/add/
Exception Value: Error when calling the metaclass bases
__init__() takes at least 2 arguments (4 given)
```