Hi
I know about passing the context to templates, but I am bit confused with the given scenario, please help
class X:
id:
name:
status:
Class Main:
number1: object of X
number2: object of X
message: "Hello World!"
I get Object of Main which has two X objects but with different contexts. I want to write one template for X and pass different conetext to it for code re usability and maintainability.
so I am trying to do this in my presentation logic, where I have object of Main
<div class="ui-tabs-panel" id="tab-results">
{% include "render/objectX.html" %}
</div>
and objectX.html
is:
{% block content %}
<div id="d">
<table id="c">
<tbody>
<tr>
<td>id : {{ x.id }}</td>
<td>name : {{ x.name }}</td>
</tr>
</tbody>
</table>
</div>
{% endblock %}
how can I pass the Main.number1(object of X) explicitly to template??
Thank you