Could not parse the remainder: '((records_list.1.key.5)' from '((records_list.1.key.5)' <p>Obligatory "I am new to Django" here...</p> <p>In my views I am creating a list, called records_list. Inside that list, I have another list in the position [0] and a dictionary in the position [1], as follows:</p> <pre><code>records_list = list() list_one = Bet.objects.order_by('-game_date') list_two = {} </code></pre> <p>Inside the "list_two", that is my dictionary, I have a key that is a date "April 2016", for ex, and a value that is a tuple: </p> <pre><code>list_two[aux_month_year] = (aux_wins, aux_losses, aux_voids, s_rate, i_rate, profit) </code></pre> <p>So I return this to my html:</p> <pre><code>records_list.append(list_one) records_list.append(list_two) return records_list </code></pre> <p>In the html, I want to create a table, and I start by checking if my profit is positive or not:</p> <pre><code>{% if records_list %} &lt;table class="table"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Date&lt;/th&gt; &lt;th&gt;Wins&lt;/th&gt; &lt;th&gt;Losses&lt;/th&gt; &lt;th&gt;Void&lt;/th&gt; &lt;th&gt;Success Rate&lt;/th&gt; &lt;th&gt;Return on Investment&lt;/th&gt; &lt;th&gt;Profit&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; {% for key in records_list.1 %} {% if ((records_list.1.key.5) &gt; 0) %} &lt;tr class="success"&gt; &lt;td&gt;{{ key }}&lt;/td&gt; &lt;td&gt;{{ records_list.1.key.0 }}&lt;/td&gt; &lt;td&gt;{{ records_list.1.key.1 }}&lt;/td&gt; &lt;td&gt;{{ records_list.1.key.2 }}&lt;/td&gt; &lt;td&gt;{{ records_list.1.key.3 }}%&lt;/td&gt; &lt;td&gt;{{ records_list.1.key.4 }}%&lt;/td&gt; &lt;td&gt;{{ records_list.1.key.5 }}&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>However, I am getting the following syntax error here:</p> <pre><code>{% if ((records_list.1.key.5) &gt; 0) %} </code></pre> <p>Error:</p> <pre><code>Could not parse the remainder: '((records_list.1.key.5)' from '((records_list.1.key.5)' </code></pre> <p>If someone could help me and point me to the right direction I would appreciate! Thank you</p>