0

I have a normal Django model. I want to give a certain user the ability to add custom fields. I want the model to update during runtime and the database migrations to apply and then the user can do regular CRUD operations.

Example of a simple Model is

class location(models.Model):
    AuotLocationID = models.CharField(max_length=200)
    LocationID = models.CharField(max_length=200)
    Name = models.CharField(max_length=200)

The user should be able to add other model fields such as Postal Code, Population, etc. Also each instance of the model should be linked to each user. For example Bob may want to track certain fields for his location and John may want some other fields.

Thank you for your help

  • Does this answer your question? [how to add dynamic fields at run time in django](https://stackoverflow.com/questions/32883759/how-to-add-dynamic-fields-at-run-time-in-django) – iklinac Apr 12 '20 at 03:48
  • This is what I found so far that looks the close to what I want to do. https://docs.djangoproject.com/en/2.1/ref/contrib/postgres/fields/#jsonfield – SUPERNOVICE Apr 12 '20 at 04:19

0 Answers0