We want to create a web page where students can give a grade for the lessons they have received.They can grade the lessons for each day of the week. So they can grade the lessons of a particular course. These lessons may have been given on any day of the week, like this:
The database contains the following tables:
class Course(models.Model):
title = models.CharField(max_length=88, null=True)
startdate = models.DateField()
enddate = models.DateField()
GivenGrades
course = models.ForeignKey(Course, on_delete=models.Cascade)
date = models.DateField()
grade = models.IntegerField(null=True)
Each cell in the grid is actually a form on itself, so we are considering using a formset construction, but how to shape it? We are faced with the problem that not all courses on each day have a grade. Also, the question with formsets is how to get the titles of courses per line on the form.
Schould we use formsets or is there a better way to get this done? And is there an example somewhere of how to achieve a grid-like formset like this?
Thanks in advance