i'm new here. I'm having a problem with django
where i have 'type'
which is a reserved keyword as a column in mongodb
. Based on answers in stackoverflow, I solved it by applying https://docs.djangoproject.com/en/1.10/ref/models/fields/#django.db.models.Field.db_column
My code currently looked like this
discountType = StringField(required=True, db_column='type')
However, the problem is the field 'type'
was changed to 'discountType'
. Is there a way to prevent the model from changing the field name?