In Django model, is it possible to have one field of that model as inline (as to have multiple instances of that field)? I can achieve this by creating an inline model and move that field there, but i'm trying to avoid TabularInline or StackedInline, and put them all together in one model.
Example of what i need is:
class Entity(models.Model):
name = models.CharField(max_length=255)
email = models.EmailField(max_length=255)
and i need the ability to add multiple instances of "email" field, without creating new Inline model.
This is can be done using the below code (But that's what i'm trying to avoid):
class Entity(models.Model):
name = models.CharField(max_length=255)
and Inline model:
class EntityEmail(models.Model):
link = models.ForeignKey(Entity)
email = models.EmailField(max_length=255)