Skip to content

Commit

Permalink
Merge pull request #51 from hapytex/issues/issue-50
Browse files Browse the repository at this point in the history
use repr for attribute values, fixing #50
  • Loading branch information
fjsj authored Jan 16, 2023
2 parents e7d364a + 3038c1d commit 9e8171b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions rest_framework_ccbv/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def __init__(self, name, value, classobject, instance_class):
self.instance_class = instance_class
self.dirty = False

@property
def repr_value(self):
return repr(self.value)

def __eq__(self, obj):
return self.name == obj.name and self.value == obj.value

Expand Down
2 changes: 1 addition & 1 deletion templates/detail_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h2>Attributes</h2>
<tr>
<td>
<code class="attribute{%if attribute.overridden %} overridden{% endif %}">
<strong>{{ attribute.name }}</strong> = {{ attribute.value|e }}
<strong>{{ attribute.name }}</strong> = {{ attribute.repr_value|e }}
</code>
</td>
<td style="min-width:100px">
Expand Down

0 comments on commit 9e8171b

Please sign in to comment.