title: Method for comparing twitter users to site users in Django / Python
body: <p>This is a follow up to an <a href="https://stackoverflow.com/questions/5137126/comparing-users-facebook-twitter-friends-to-sites-users-in-python-django" title="earlier question">earlier question</a>. I'm using the below code to get a user's friends and then compare them to the users of my site to show a "Friends already using this site" list.</p>
  
  <p>It's working perfectly, but is this an efficient way to do it?  Any recommendations?</p>
  
  <p><em>in views.py</em></p>
  
  <pre><code># Get Twitter Friends
  api = twitter.Api(consumer_key='TWITTER_TOKEN',
                        consumer_secret='TWITTER_SECRET',
                        access_token_key='request.user.get_profile.oauth_token',
                        access_token_secret='request.user.get_profile.oauth_secret')
  friends = api.GetFriendIDs(request.user.username)
  
  # Compare friends with High Five users    
  profiles = Profile.objects.filter(twitter_id__in = friends['ids'])
  </code></pre>
  
  <p><em>in template.html</em></p>
  
  <pre><code>&lt;h2&gt;Friends&lt;/h2&gt;
      &lt;ul&gt;
      {% for profile in profiles %}
          &lt;li&gt;
              &lt;a href="/user/{{ profile.user.username }}"&gt;
                  &lt;img src="{{ profile.profile_image_url }}" /&gt;
              &lt;/a&gt;
          &lt;/li&gt;
      {% endfor %}
      &lt;/ul&gt;
  </code></pre>