I am always trying to do this.
I do not understand that there are no more guidelines in templates.
- My profile page requires a list of friends
Something like this:
{% Friendship.of friends } For% lt; Li & gt; Are_friends: {{friends.are_friends.user.username}} & lt; / Li & gt; & Lt; Li & gt; Is_invited: {{friends.is_invited}} & lt; / Li & gt; {% Endfor%}
Better jing and normally new in programming It's been a bit like this that took me to work, but in the end I was there, so what did I do to sick? At first though this code may not be exactly what you want, but you will get this idea. I can make some mistakes or there is a better way to do this, so it's not right that this is the most correct way, but it works.
At first I split my code into two templates when I am on my "Management Management" page, I am on another user's profile page and for one. Please keep in mind that this is basically a pure template code and no styling is implemented in it. {% For% in list} {{m}}
User% {% Endfor%} {% endwith%} {% else%} Search for friends {% endif%} { % User is being friends with the user}%} {% with user. In the form of friendship, inquiry as%} {% if list.received%} friendship request was received {% for list.received%} in {{m}} & lt; A href = "{% url friendship_accept m.from_user%}" & gt; Accept request & lt; / A & gt; & Lt; A href = "{% url friendship_decline m.from_user%}" & gt; Rejected request & lt; / A & gt; & Lt; A href = "{% url user_block m.from_user%}" & gt; Block User & lt; / A & gt; {% Endfor%} {% endif%} {% list.sent%} If your friend request is pending {% m in list.sent%} {% if not if there are no users. Blocked: m.to_user%} {{m.to_user}} & lt; A href = "{% url friendship_cancel m.to_user%}" & gt; Request request & lt; / A & gt; {% Endif%} {% endfor%} {% endif%} {% endwith%} {% endif%} {% user if% blocks%} {% with user. Block in the list%} {% if list.applied% {%} List.applied%} {{m}} {% endfor%} {% endif%} {% endwith%} {% endif%} I have the following code for the user's profile page {/ code> I have a profile app that is passing in the username of the profile that I am looking for And I want to talk together. You may need to find another way to do this.
Hope it helps.
Comments
Post a Comment