[Answered ]-Django create db table headers from dict

1👍

You can assign this to the local variables, but I would advise against this:

_dict = {
    'column_1': models.IntegerField(),
    'column_2': models.IntegerField()
}

class MyModel(models.Model):
    locals().update(_dict)

Leave a comment