4

I'm using Django 1.3beta and django-mongodb-engine for database backend.

Problem is when I save an object with a pk set I get this error:

/usr/local/lib/python2.6/dist-packages/django/db/models/fields/__init__.pyc in get_prep_lookup(self, lookup_type, value)
    290             return value
    291         elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'):
--> 292             return self.get_prep_value(value)
    293         elif lookup_type in ('range', 'in'):
    294             return [self.get_prep_value(v) for v in value]

/usr/local/lib/python2.6/dist-packages/django/db/models/fields/__init__.pyc in get_prep_value(self, value)
    477         if value is None:
    478             return None
--> 479         return int(value)
    480
    481     def contribute_to_class(self, cls, name):

    ValueError: invalid literal for int() with base 10: '4cc75881006e4a1e0f000000'

I guess it is because mongodb items are stored with a key in hexadecimal, while django expects an int.

Any ideas what I can do about this?

1 Answer 1

3

You'll need django-nonrel fork of django. If you'll follow the link you've posted, you'll see it's specified in "Requirements"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.