I did not get it please provide models.py

On Fri, Jan 10, 2020 at 6:07 PM Akshat Zala <[email protected]> wrote:

> my view to display friendlist:
>
> def friend_list(request):
>     context = {
>         'results_from_user':
>                         Friend.objects.filter(from_user=request.user),
>         'results_to_user': Friend.to_user
>     }
>     return render(request, 'friend/friend_list.html', context)
>
> my template:
>
>    {% for result in results_from_user %}
>     {% if result.from_user == result.to_user %}
>     <tr>{{pass}}</tr>
>     {% endif %}
>     <tr>
>     <td>
>         <img src="{{ result.from_user.profile.image.url }}" 
> class="rounded-circle account-img"/>
>     </td>
>     <td>
>         <ul>
>             <li>
>                 <a href="{% url 'profile' result.from_user.id 
> %}">{{result.from_user.first_name}} {{result.from_user.last_name }}</a>
>             </li>
>         </ul>
>     </td>
>
> It displays name of the logged in user with profile picture in a tabular
> format.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/93780763-f241-44c7-ac71-83d898c842ef%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/93780763-f241-44c7-ac71-83d898c842ef%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
<https://about.me/sagarninave?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>
sagar ninave
about.me/sagarninave
<https://about.me/sagarninave?promo=email_sig&utm_source=product&utm_medium=email_sig&utm_campaign=gmail_api&utm_content=thumb>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA6pdZ_eWgmsCG-9Yn8aE8FZAOkNAu3A%2BHEvJ4vGc2swsnNhqA%40mail.gmail.com.

Reply via email to