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

After upgrading to 0.7 i get this error #111

Closed
ozexpert opened this issue Sep 4, 2012 · 4 comments
Closed

After upgrading to 0.7 i get this error #111

ozexpert opened this issue Sep 4, 2012 · 4 comments

Comments

@ozexpert
Copy link

ozexpert commented Sep 4, 2012

/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/mongoengine/fields.py:732: FutureWarning: ReferenceFields will default to using ObjectId strings in 0.8, set DBRef=True if this isn't desired
warnings.warn(msg, FutureWarning)
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x19a17d0>>
Traceback (most recent call last):
File "/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run
self.validate(display_num_errors=True)
File "/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/django/core/management/validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/django/db/models/loading.py", line 158, in get_app_errors
self._populate()
File "/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/django/db/models/loading.py", line 64, in _populate
self.load_app(app_name, True)
File "/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/django/db/models/loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
import(name)
File "/home/young/Webproject/p4n/../p4n/common/models/init.py", line 18, in
class User(DiffDirtyMixin, BaseUser):
File "/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/mongoengine/base.py", line 796, in new
for spec in meta['indexes']]
File "/home/young/.virtualenvs/p27d14mongonew/local/lib/python2.7/site-packages/mongoengine/queryset.py", line 515, in _build_index_spec
if key.startswith("-"):
AttributeError: 'tuple' object has no attribute 'startswith'

@AlexKovalevych
Copy link

the same issue here, mongoengine version 0.7, python version 2.7.3, mongodb version 2.0.7. Ideas?

@shinnpet
Copy link

shinnpet commented Sep 4, 2012

same issue , I cracked the code and it works now
Foucs on the function parameters (spec)

def _build_index_spec(cls, doc_cls, spec_old):
"""Build a PyMongo index spec from a MongoEngine index spec.
"""

    #----------add by shinnpet---------------
    import copy
    spec = copy.copy(spec_old)
    #-------------------------------------------------

rozza added a commit that referenced this issue Sep 4, 2012
@rozza
Copy link
Contributor

rozza commented Sep 4, 2012

Apologies all, that got missed in the release candidate - this has been fixed and 0.7.1 has been released to pypi

@rozza rozza closed this as completed Sep 4, 2012
@shinnpet
Copy link

shinnpet commented Sep 4, 2012

thanks rozza's effort !

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

4 participants