I've got a model named MyUser with a user_type field which can be of the following different user types
USER_TYPE_STUDENT
USER_TYPE_TEACHER
USER_TYPE_DIRECTOR
In one of the models, I've got the following field
student = models.ForeignKey(MyUser, null=True, related_name='requests',
limit_choices_to={'user_type': MyUser.USER_TYPE_STUDENT}, ...)
As you can read, it uses
limit_choices_to={'user_type': MyUser.USER_TYPE_STUDENT}
Thing is, in a OneToOneField field (students_or_teachers), I would like to declare that field is limited to user_type USER_TYPE_STUDENT or USER_TYPE_TEACHER.
How can that be done?