1👍
✅
You can implement related_name attributes something similar to this:
from django.contrib.auth.models import User
class ClassRoom(models.Model):
# One classroom one teacher
teacher = models.ForeignKey(User, related_name="teacher")
# One classroom many students
student = models.ManytoManyField(User, blank=True, null=True,
related_name="students")
.....
Also refer to these links for more info:
Django model with Foreign Key and ManyToMany relations to same model
Two sets of users (teacher and student) in Django authentication
Source:stackexchange.com