Django dynamic model fields
问题 I\'m working on a multi-tenanted application in which some users can define their own data fields (via the admin) to collect additional data in forms and report on the data. The latter bit makes JSONField not a great option, so instead I have the following solution: class CustomDataField(models.Model): \"\"\" Abstract specification for arbitrary data fields. Not used for holding data itself, but metadata about the fields. \"\"\" site = models.ForeignKey(Site, default=settings.SITE_ID) name =