Open shirke95 opened 2 years ago
i want save custom _id field
Hey first of all remove id filed for abstract model class. It actually conflicts the property of modelling. Put this id field into the Projects model. And you can use the ObjectIdField from bson. Actually in djongo bson ObjectIdField is used internally. Hope this resolve your issue.
If you use serializers make sure that you have put id fields as a read_only one. Otherwise it will receive the wrong value.
One line description of the issue
is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string
Python script