from django.db import models
class hoge(models.Model):
hoge_id = models.IntegerField()
hoge_text = models.CharField()
To get the field name of a class defined as
field_names = [field.name for field in hoge._meta.fields]
You can get it with this.
Recommended Posts