Get a random object from a list of objects with template
<p>I'm listing every fonts I have in my models database under each icon from another model.</p>

<p>I would like to get <strong>one</strong> random font for each icon.</p>

<p>Here is how I show my template file :</p>

<pre><code>{% for Fo in FormOne %}
    {% for Ft in FormTwo %}
        {% for f in Ft.icon.all %}          
            &lt;p&gt;{{ f.icon_name }}&lt;/p&gt;        #for each icon name
            {% for f in Fo.checkbox.all %}
                &lt;p&gt;{{ f.font_name }}&lt;/p&gt;    #show one random font name.
            {% endfor %}
        {% endfor %}
    {% endfor %}
{% endfor %}
</code></pre>

<p>I got the context of my view like this :</p>

<pre><code>context = {'FormOne':FormOne.objects.all(), 'FormTwo':FormTwo.objects.all()}
</code></pre>

<p>here is my <strong>model</strong> structure : </p>

<pre><code>class Font(models.Model):
    font_name = models.CharField(max_length=100)
    font_css = models.CharField(max_length=100)

class FormOne(models.Model):
    name = models.CharField(max_length=40)
    checkbox = models.ManyToManyField(Font, blank=True)
    ...

class Icons(models.Model):
    icon_name = models.CharField(max_length=100)
    ...

class FormTwo(models.Model):
    owner = models.ForeignKey(FormOne)
    icon = models.ManyToManyField(Icons, blank=True)
    ...
</code></pre>

<p>How can I achieve it ?</p>