0

I'm trying to add another attribute in HTML (placeholder) using Django Widgets, when I do it, they don't appear in the HTML.

models.py

class InvitadosIngreso(forms.ModelForm):
    class Meta:
        model = InvitadosIngreso
    
        fields = ['oficina_pro' 
                    ,'documento'
                   
        
        widgets = {
            'oficina_pro' : forms.Select(attrs={'class':'form-control'},choices=ch_pro)
            ,'documento ': forms.TextInput(attrs={'class':'form-control', 'placeholder':'prueba',})
        }
   

forms.py

class InvitadosIngreso(models.Model):
   

 oficina_pro = models.CharField(max_length=100, default='')
    documento = models.CharField(max_length=100, default='')
    nombre = models.CharField(max_length=100, default='')
    
    class Meta:
    db_table = 'InvitadosIngreso'
 
TrueAFM
  • 27
  • 4

0 Answers0