mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
iter over items in python, not template
This commit is contained in:
parent
95380f7717
commit
41ce298067
|
@ -1,7 +1,7 @@
|
|||
{% load rest_framework %}
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
{% for key, value in value.items %}
|
||||
{% for key, value in value %}
|
||||
<tr>
|
||||
<th>{{ key|format_value }}</th>
|
||||
<td>{{ value|format_value }}</td>
|
||||
|
|
|
@ -148,7 +148,7 @@ def format_value(value):
|
|||
return template_render(template, context)
|
||||
elif isinstance(value, dict):
|
||||
template = loader.get_template('rest_framework/admin/dict_value.html')
|
||||
context = {'value': value}
|
||||
context = {'value': value.items()}
|
||||
return template_render(template, context)
|
||||
elif isinstance(value, six.string_types):
|
||||
if (
|
||||
|
|
Loading…
Reference in New Issue
Block a user