title: How to filter case-insensitive on oneToOneField in django
body: <p>I'm trying to filter case-insensitive on the auth_user model which has a oneToOne relation with my model as shown in code beneath.</p>
  
  <pre><code>class Profile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE)
      headline = models.TextField(max_length=120, null=True)
  </code></pre>
  
  <p>Normally to filter case-insensitive '__icontains' does the job, however if I filter with the following code, it is still case-sensitive even though I used icontains.</p>
  
  <pre><code>profiles = profiles.filter(Q(user__first_name__icontains=search) |
                                 Q(user__last_name__icontains=search)).order_by('-id')
  </code></pre>
  
  <p>I think the problem is with using 'user__first_name' since it is a field of a module related to profile and filtering on 'headline' which is a direct field of profile can be done case-insensitive.</p>
  
  <p>Any idea what the best solution is for this problem?</p>