This is my Django code for my model I want to have columns in the model based on the value of chart type enter column there`
class DashboardCreativeQuery(models.Model):
query_name = models.CharField(max_length=256, null=False, unique=True)
query = models.TextField( null=False)
chart_type = models.ForeignKey(DashboardCreativeCharts, blank=True, null=True, related_name='chart_type',
on_delete=models.CASCADE)
if chart_type:
test= JSONField(null=False)
How can I do it?