Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- names = {
- 'name1': {
- 'name': 'sarah',
- 'age': '20',
- 'roles': {
- 'a1': 'aa', 'a2': 'az', 'a3': '1',
- 'b1': 'bb', 'b2': 'bz', 'c3': '0',
- 'c1': 'cc', 'c2': 'cz', 'c3': '2',
- }
- },
- 'name2': {
- 'name': 'dave',
- 'age': '24',
- 'roles': {
- 'a1': 'aa', 'a2': 'az', 'a3': '1',
- 'b1': 'bb', 'b2': 'bz', 'c3': '0',
- 'c1': 'cc', 'c2': 'cz', 'c3': '2',
- }
- },
- 'name3': {
- 'name': 'rick',
- 'age': '22',
- 'roles': {
- 'a1': 'aa', 'a2': 'az', 'a3': '1',
- 'b1': 'bb', 'b2': 'bz', 'c3': '0',
- 'c1': 'cc', 'c2': 'cz', 'c3': '2',
- }
- }
- }
- pd = {
- 'msg': names,
- }
- return render(request, 'basketball.html', context=pd)
- {% for id, info in msg.items %}
- <tr>
- <td>{{ info.names }}</td>
- <td>{{ info.age}}</td>
- {% for s, v in info.roles.items %}
- <td>{{ v.a1}}<br />{{ v.a2}}</td>
- <td>{{ v.b1}}<br />{{ v.b2}}</td>
- <td>{{ v.c1}}<br />{{ v.c2}}</td>
- {% endfor %}
- </tr>
- {% endfor %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement