Skip to content

Commit

Permalink
use repr for attribute values, fixing #50
Browse files Browse the repository at this point in the history
  • Loading branch information
KommuSoft committed Jan 11, 2023
1 parent e7d364a commit 3038c1d
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 3038c1d

Please sign in to comment.