Programmatically specifying Django model attributes
- by mojbro
Hi!
I would like to add attributes to a Django models programmatically, at run time. For instance, lets say I have a Car model class and want to add one price attribute (database column) per currency, given a list of currencies.
What is the best way to do this?
I had an approach that I thought would work, but it didn't exactly. This is how I…