title: Display the users that belong to a certain group in Django ModelForm
body: <p>I have constructed the below model. I think this can be easily be asked but I am really stuck to that!</p>
  
  <p><strong>part of the Model</strong></p>
  
  <pre><code>class Task(models.Model):
      Taskdetails = models.CharField(max_length=500, null=True)    
      employee = models.ForeignKey("auth.User", null = True)
  
      def __str__(self):
          return str(self.id)
  </code></pre>
  
  <p><strong>Form</strong></p>
  
  <pre><code>class TaskForm (ModelForm):
  
      class Meta:
          model = Task
          fields = ('Taskdetails','employee',)
  </code></pre>
  
  <p><strong>part of the views</strong></p>
  
  <pre><code>def task_new(request):
      if request.method == "POST":
          task_form = TaskForm(request.POST)
  
          if task_form.is_valid():
             task_form.employee = User.objects.filter(groups__name='supervisor')
  </code></pre>
  
  <p>So in my template while I create a model instance, in the dropdown menu, i am trying to display <strong>only</strong> the users that belong to a certain group (in this example in the group supervisor). On the contrary, in the template the dropdown menu shows all the users, not taking into consideration the filter that I put in views.</p>
  
  <p>To sum up, I am trying to figure out in Django 1.9 edition to filter the users by groups. </p>
  
  <p>Also important to mention that i am using the default User model so the attribute <em>group</em> is not declared in the model. When I write the below line to the Python console, it shows only the users that belong to the group "supervisor".</p>
  
  <pre><code>User.objects.filter(groups__name='supervisor')  
  </code></pre>