Quick question. I\'m trying yo access one of the fields of a model using a variable.
class ExampleModel(models.Model): the_field = models.CharField()
You can use pythons getattr function to do this. Pass the field name in as the attribute.
getattr(model, fieldtoget)
Since fieldtoget is a variable, this is dynamic.
You can use setattr to set it the same way.