I know about passing context to templates, but I'm a little confused in this scenario, please help
class X:
id: name: status:
Main Class:
number1: object of X number2: object of X message: "Hello World!"
I get an Object of Main that has two X objects, but with different contexts. I want to write one template for X and pass it another conetext for ease of use of code and ease of maintenance.
so I'm trying to do this in my view logic, where I have a Main object
<div class="ui-tabs-panel" id="tab-results"> {% include "render/objectX.html" %} </div>
and objectX.html :
{% 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 Main.number1 (object X) explicitly to the template?
thanks
source share