Add organization data serialization to OrgDetailView
This commit is contained in:
parent
61647f72d4
commit
0322744104
2 changed files with 10 additions and 0 deletions
|
|
@ -34,4 +34,5 @@
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
<pre><code>{{ org_data }}</code></pre>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,18 @@ class OrgDetailView(DetailView):
|
||||||
|
|
||||||
games: QuerySet[Game, Game] = organization.games.all() # pyright: ignore[reportAttributeAccessIssue]
|
games: QuerySet[Game, Game] = organization.games.all() # pyright: ignore[reportAttributeAccessIssue]
|
||||||
|
|
||||||
|
serialized_org = serialize(
|
||||||
|
"json",
|
||||||
|
[organization],
|
||||||
|
fields=("name",),
|
||||||
|
)
|
||||||
|
org_data = json.loads(serialized_org)
|
||||||
|
pretty_org_data = json.dumps(org_data[0], indent=4)
|
||||||
|
|
||||||
context.update({
|
context.update({
|
||||||
"subscription": subscription,
|
"subscription": subscription,
|
||||||
"games": games,
|
"games": games,
|
||||||
|
"org_data": pretty_org_data,
|
||||||
})
|
})
|
||||||
|
|
||||||
return context
|
return context
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue