I'm building a school management application
In this there is an option for teachers to create student accounts when the number of students is specified ..
Which is the best possible method to do this ..
I would just accept a student number from the teacher, make a bulkCreate method on the Student model that takes the number, then simply loop through and new up the required number if students.
@athulpraj Does the teacher need to provide names and other data? Teacher enters number of students then a form list is displayed for the proper amount of students. When the form is submitted create the student users. Passwords could be randomly generated and displayed to the teacher or allow the teacher to set a common password. Obviously you need to check on login so the student is required to change their password.
@jekinney Yeah, it would be a lot of null values, but if you want to make new students based only on a number of students, you're going to have null values no matter what you do. Maybe the OP wants to only create the empty students accounts but then let the teachers/students fill out the rest? I guess it would help to have a bit more information.