mongodb - Django table column is a number -


is there way if database column uses number (0,1,2,3,4,5) set django model? database created mongodb, can't make changes it, easy/fast workaround?

you can set django model different field names , set db_column param each field corresponds database column name. example:

class example(models.model):     firstfield = models.integerfield(db_column='0')     secondfield = models.charfield(db_column='1')     ... 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -