title: How to add an attribute to an option in a select form in django python
body: <p>I have  models</p>
  <pre><code>class tipo_pago(models.Model):
      descripcion = models.CharField(max_length=20)
      banco_req   = models.BooleanField(default=False, verbose_name=&quot;Requiere banco&quot;, help_text=&quot;Activa esta casilla si se requiere el banco de origen&quot;)
      status      = models.BooleanField(default=True)
  </code></pre>
  <p>and</p>
  <pre><code>class cliente_pago(models.Model):
      tEstado = (
          ('pagado','Pagado'),
          ('pendiente','Pendiente'),
          ('cancelado','Cancelado'),
      )
  
      cliente     = models.ForeignKey('cliente',blank=False,null=True,on_delete=models.SET_NULL)
      fecha       = models.DateTimeField(default=timezone.now)
      fecha_pago  = models.DateField()
      tipo_pago   = models.ForeignKey('tipo_pago',blank=False,null=True,on_delete=models.SET_NULL)
      banco       = models.ForeignKey('banco', blank=True, null=True,on_delete=models.SET_NULL)
      referencia  = models.CharField(max_length=25)
      cuenta      = models.ForeignKey('cuenta',blank=False,null=True,on_delete=models.SET_NULL)
      importe     = models.FloatField(default=0)
      pago        = models.FloatField(default=0)
      saldo       = models.FloatField(default=0)
      observacion = models.TextField(blank=True,null=True)
      estado      = models.CharField(max_length=10,default='pendiente',choices=tEstado)
  </code></pre>
  <p>My form to fill the fileds is the next one:</p>
  <pre><code>class cliente_pagoModal(CustomModelForm):
  
      class Meta:
          model   = cliente_pago
          exclude = ('fecha','pago','saldo','estado',)
  </code></pre>
  <p>To the field <code>tipo_pago</code> in <code>cliente_pago</code> form i want to add a data parameter</p>
  <p>Now look like this:</p>
  <pre><code>&lt;select name=&quot;tipo_pago&quot; class=&quot;form-control&quot; required=&quot;&quot; id=&quot;id_tipo_pago&quot;&gt;
    &lt;option value=&quot;&quot; selected=&quot;&quot;&gt;---------&lt;/option&gt;
    &lt;option value=&quot;3&quot;&gt;Efectivo&lt;/option&gt;
    &lt;option value=&quot;2&quot;&gt;Cheque&lt;/option&gt;
    &lt;option value=&quot;1&quot;&gt;Transferencia bancar&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  <p>but I want it to look like this</p>
  <pre><code>&lt;select name=&quot;tipo_pago&quot; class=&quot;form-control&quot; required=&quot;&quot; id=&quot;id_tipo_pago&quot;&gt;
    &lt;option value=&quot;&quot; selected=&quot;&quot;&gt;---------&lt;/option&gt;
    &lt;option value=&quot;3&quot; data-banco_req=&quot;0&quot;&gt;Efectivo&lt;/option&gt;
    &lt;option value=&quot;2&quot; data-banco_req=&quot;1&quot;&gt;Cheque&lt;/option&gt;
    &lt;option value=&quot;1&quot; data-banco_req=&quot;2&quot;&gt;Transferencia bancar&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  <p>I am using python 3.7 and django 2.0.8</p>