[Answer]-Append choices to choice list in Django models dynamically

1👍

I think your choice of type field is incorrect. Basically CharField with choices has limited functionality and you can’t do this with it you can only filter the choices you declared initially but you can’t add new ones on the fly (you will see them but they will not pass the field validation). I think you should go with ForeignKey where you do not have such limitations. You can build it dynamically without ptoblems. I can’t tell you the queries without seeing some code.

👤kpacn

Leave a comment