title: Django: Trouble filtering my Artist model to show objects from the request user
body: <p>So I have a model in a different app that records a user's 5 favorite artists. The model is uses the user as a foreign key through my own custom userprofile model. So I want to display the list of favourite artists linked to the request profile when I log in and I want to display it. But im having trouble filtering it because I keep getting an error saying the request user needs to be a userprofile instance.
  Heres my music model</p>
  <pre><code>    from django.db import models
  from accounts.models import UserProfile
  
  # Create your models here.
  class Artist(models.Model):
      artist_name = models.CharField(default='', max_length=200)
      artist_name2 = models.CharField(default='', max_length=200)
      artist_name3 = models.CharField(default='', max_length=200)
      artist_name4 = models.CharField(default='', max_length=200)
      artist_name5 = models.CharField(default='', max_length=200)
      updated = models.DateTimeField(auto_now=True)
      created = models.DateTimeField(auto_now_add=True)
      as_pro = models.OneToOneField(UserProfile, on_delete=models.CASCADE, related_name='artist')
  
  
      def __str__(self):
          return f&quot;{self.as_pro}-{'Artist List'}&quot;
  </code></pre>
  <p>and heres my profile view in the accounts app</p>
  <pre><code>def profile(request):
      userprofile = UserProfile.objects.get(user=request.user)
      obj = Artist.objects.filter(as_pro=request.user)
  
  
      context = {
          'userprofile': UserProfile,
          'obj' : obj,
      }
      
      return render(request, 'accounts/profile.html', context)
  </code></pre>
  <p>heres also my profile template where I want to display it but like I said I'm finding it hard to crack why I cant display a simple list.</p>
  <pre><code>                    &lt;/div&gt;
                      
                        &lt;p&gt;{{ obj.artist_name }}&lt;/p&gt;
                        &lt;p&gt;{{ obj.artist_name2 }}&lt;/p&gt;
                        &lt;p&gt;{{ obj.artist_name3 }}&lt;/p&gt;
                        &lt;p&gt;{{ obj.artist_name4 }}&lt;/p&gt;
                      
                      
      
                  &lt;/div&gt;
  </code></pre>