You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First time I'm trying to use MongoDB with Django.
Error in your module.. boom!
/usr/lib/python3.4/site-packages/djangotoolbox/db/base.py in _value_for_db_collection(self, value, field, field_kind, db_type, lookup)
481 # "list" may be used for SetField.
482 #print("Type: "+str(db_type))
--> 483 if db_type in 'list':
484 return list(value)
485 elif db_type == 'set':
TypeError: 'in <string>' requires string as left operand, not NoneType
When trying to create ListField() in the model as per example.
3-4 hours of debugging step by step brought me to this solution:
class NonrelDatabaseWrapper(BaseDatabaseWrapper):
data_types={'ListField':'list'}
Next step is to solve this crap:
/usr/lib/python3.4/site-packages/django/db/models/fields/__init__.py in get_prep_value(self, value)
983 if value is None:
984 return None
--> 985 return int(value)
986
987 def contribute_to_class(self, cls, name, **kwargs):
TypeError: int() argument must be a string, a bytes-like object or a number, not 'ObjectId'
When saving the actual model.
The text was updated successfully, but these errors were encountered:
First time I'm trying to use MongoDB with Django.
Error in your module.. boom!
When trying to create ListField() in the model as per example.
3-4 hours of debugging step by step brought me to this solution:
Next step is to solve this crap:
When saving the actual model.
The text was updated successfully, but these errors were encountered: