Эксперт заполняет Blank_list выбранным Сотрудником. 5 экспертов, будет 5 Blank_list. Как сложить пять пустых_список?
models.py :
ANSWER_TYPES = (
(0, 0),
(1, 1),
)
class Expert(models.Model):
expertname = models.CharField(max_length=200, null=True)
position = models.CharField(max_length=200, null=True)
class Employee(models.Model):
employeename = models.CharField(max_length=200, null=True)
position = models.CharField(max_length=200, null=True)
class Blank_list(models.Model):
expert_name = models.ForeignKey(Expert, null=True, on_delete=models.SET_NULL)
employee_name = models.ForeignKey(Employee, null=True, on_delete=models.SET_NULL)
lvl_1 = models.IntegerField('Indicator1:1', choices=ANSWER_TYPES, blank=0)
lvl_2 = models.IntegerField('Indicator1:2', choices=ANSWER_TYPES, blank=0)
lvl_3 = models.IntegerField('Indicator1:3', choices=ANSWER_TYPES, blank=0)
class EmployeeCard(models.Model):
blank_list = models.ManyToManyField(Blank_list, null=True, ) #there is a list of Blank_list
#don't know if blank_list a correct field?
employee_name = models.ForeignKey(Employee, null=True, on_delete=models.SET_NULL)
sum_of_all_blank_list = ...