Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'object' object has no attribute '__contains__' #61

Open
prydie opened this issue Nov 16, 2013 · 1 comment
Open

'object' object has no attribute '__contains__' #61

prydie opened this issue Nov 16, 2013 · 1 comment

Comments

@prydie
Copy link

prydie commented Nov 16, 2013

Commit efa1bb1 introduced changes to LazyDocumentMetaWrapper which is now throwing the following error for us.

Any ideas?
Andrew

Environment:


Request Method: POST
Request URL: http://127.0.0.1:8001/users/products/edit/viber-stretch-dress/

Django Version: 1.6
Python Version: 2.7.5
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'gunicorn',
 'south',
 'djcelery',
 'mongodbforms',
 'bootstrapform',
 'post_office',
 'extra_views',
 'tastypie',
 'redirect',
 'accounts',
 'aws_upload',
 'staff',
 'project',
 'products',
 'advertisers',
 'project_custom_tags',
 'api',
 'debug_toolbar')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware')


Traceback:
File "/Users/andrew/.virtualenvs/project/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  90.                 response = middleware_method(request)
File "/Users/andrew/.virtualenvs/project/lib/python2.7/site-packages/django/utils/importlib.py" in import_module
  40.         __import__(name)
File "/Users/andrew/Projects/project/site/project/project/urls.py" in <module>
  38.     (r'^staff/', include('staff.urls')),
File "/Users/andrew/.virtualenvs/project/lib/python2.7/site-packages/django/conf/urls/__init__.py" in include
  26.         urlconf_module = import_module(urlconf_module)
File "/Users/andrew/.virtualenvs/project/lib/python2.7/site-packages/django/utils/importlib.py" in import_module
  40.         __import__(name)
File "/Users/andrew/Projects/project/site/project/staff/urls.py" in <module>
  2. from staff.views import *
File "/Users/andrew/Projects/project/site/project/staff/views.py" in <module>
  4. from staff.forms import (
File "/Users/andrew/Projects/project/site/project/staff/forms.py" in <module>
  92. class ProductCategoryForm(DocumentForm):
File "/Users/andrew/.virtualenvs/project/lib/python2.7/site-packages/mongodbforms/documents.py" in __new__
  309.             getattr(new_class, 'Meta', None)
File "/Users/andrew/.virtualenvs/project/lib/python2.7/site-packages/mongodbforms/documents.py" in __init__
  276.             self.document._meta = DocumentMetaWrapper(self.document)
File "/Users/andrew/.virtualenvs/project/lib/python2.7/site-packages/mongodbforms/documentoptions.py" in __init__
  146.         if 'id_field' in self._meta:
File "/Users/andrew/.virtualenvs/project/lib/python2.7/site-packages/mongodbforms/documentoptions.py" in __contains__
  95.         return self._wrapped.__contains__(key)

Exception Type: AttributeError at /users/products/edit/viber-stretch-dress/
Exception Value: 'object' object has no attribute '__contains__'
@jschrewe
Copy link
Owner

Sorry for the late answer. My Internet provider decided to stop working for a couple days.

The above commit should take care of your issue and hopefully not introduce new issues. It's a bit messier then I would have liked because I'm in the process of cleaning up mongoadmin for Django 1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants