I need to add dynamic fields at runtime in my django application, but I don't know how to correctly add new fields at runtime.
I want to add code that will generate a dynamic field, and will also update the database. I am using postgresql database. please help if anyone can.
My "model.py" looks like this:
class Student(models.Model):
name=models.CharField(max_length=100)
school=models.CharField(max_length=100)
created_at=models.DateField(auto_now_add=True)
is_active=models.BooleanField(default=False)
def __str__(self):
return self.name
source
share