I am making a portal for the procedure of Interview rounds. My basic code is as follows:
models.py
class Round(models.Model):
pending_students = models.ManyToMany(User, related_name='pending_student', blank=True)
done_students = models.ManyToMany(User, related_name='done_students', blank=True)
round_number = models.PositiveIntegerField(default=0)
#other fields
First, for the current round, I am displaying pending_students
and done_students
separately. Current user will bring some pending to done(and done to pending if he wants) and then he will submit. I want that, On submitting, next round should be created.
Now I want that if new round is created, then all done_students
of previous round should come to pending_students for this newly created round. I am using generic create view (but if needed, I am fine with writing manually).
Now problem is that in create view, how can I know which student should go to next round (means who are in the list of done_students on client side) ? I want to know, how can I pass the id's of all done_students from HTML page to newly called create view to create next round ?
Any suggestion for different way is welcomed. I want to get it any way.