Answer the question
In order to leave comments, you need to log in
Issue with ForeignKey List in Django ModelForm?
I have a list of employees.
models.py:
class NumberOfMealsEaten(models.Model):
month = models.ForeignKey(Months, on_delete=models.CASCADE)
staff = models.ForeignKey(Staffs, on_delete=models.CASCADE)
maelseaten = models.IntegerField("Number of meals eaten", validators=[MinValueValidator(0)], default=0)
def __str__(self):
return str(self.staff)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question