0

I have a field in my student model called counselors. All I am trying to do is list the users that are in the group counselors to be displayed in this many to many relationship. How do i go about doing this? Here is the field in my model. Thanks

  counselor = models.ForeignKey(User, related_name='Counselors', on_delete = models.PROTECT,null=True,blank = True)

The current setup only shows all the users within the User table not Users associated in the Counselors group.

Ray Zuchowski
  • 363
  • 2
  • 12

1 Answers1

0
counselor = models.ForeignKey(User, limit_choices_to={'groups__name': "Counselors"},on_delete = models.PROTECT,null=True,blank = True )
Ray Zuchowski
  • 363
  • 2
  • 12