Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # views.py
- profiles = UserProfile.objects.select_related('user').filter(user__in=[1,6,7,8])
- # template.html
- {% for user in profiles %}
- <li>
- <a href="">
- {% if user.photo %}
- <img src="{{ user.photo.thumbnail.url }}" alt="" />
- {% else %}
- <img src="{{ MEDIA_URL }}images/lay-avatar.png" alt="" title="" />
- {% endif %}
- </a>
- </li>
- {% endfor %}
Add Comment
Please, Sign In to add comment