Django choices and dictionary
<p>I have code</p>

<pre><code>JOBS = 1
CATEGORY_CHOICES = ((JOBS, "Jobs"),)
</code></pre>

<p>And code in the model</p>

<pre><code>category = models.IntegerField(choices=CATEGORY_CHOICES, default=JOBS)
</code></pre>

<p>Instead of "jobs" I want to add a dictionary and have access to it in the template. For example</p>

<pre><code>JOBS = 1
CATEGORY_CHOICES = ((JOBS, {'title':"Jobs",'icon':"fa fa-briefcase",'slug':"jobs"}),)
</code></pre>

<p>But instead I get the following</p>

<p><a href="https://i.stack.imgur.com/Oc7Jw.png" rel="nofollow"><img src="https://i.stack.imgur.com/Oc7Jw.png" alt="enter image description here"></a></p>

<p>How to add the dictionary into the choices?
I was able to create a model, which would be set up: title and icon. But instead, I decided to create a choice. Title I can add, but for the selected item to set the icon?</p>

<p>Tuples are immutable.I Think it's impossible.</p>

python django dictionary