I have a Job model with fields name, description and some parameters:
class Job(models.Model):
name = models.CharField(max_length=200)
description = models.TextField(default='Add comprehensive job description')
# parametes
lat_lim=[MinValueValidator(-90), MaxValueValidator(90)]
long_lim=[MinValueValidator(-180), MaxValueValidator(180)]
lattitude = models.IntegerField('Lattitude North default value', null=True, validators=lat_lim)
longitude = models.IntegerField('Lattitude South default value', null=True, validators=long_lim)
time_query_begin = models.DateField('Job query start time', null=True, blank=True)
...
Now, I would like a more dynamic approach, where each job has different number of parameters and parameter types. It could be, that job1 has parameters such as height, longitude, lattitude and time_query_begin, and job2 has parameters such as height and temperature etc.
I was thinking of making a ManyToMany relation to a Parameter model, containing fields name, default_value, min, max.
What is the best way to accomplish this?
Note: I have seen this question: Django dynamic model fields , but I not sure if it solves my problem.