models.py: класс Ligne (models.Model):
Num_ligne = models.DecimalField(max_digits=8, decimal_places=0, null=True)
CIN_ab = models.DecimalField(max_digits=8, decimal_places=0, null=True)
FIXE='fx'
MOBILE='mob'
ligne_types = [
(FIXE, 'Fixe'),
(MOBILE, 'Mobile'),
]
Type = models.CharField(max_length=100,choices=ligne_types, null=True)
forms.py: класс Ligne_form (forms.ModelForm):
Reseau=forms.CharField(required=False,disabled=True)
Localisation=forms.CharField(required=False,disabled=True)
class Meta:
model = Ligne
fields= [
'Num_ligne',
'CIN_ab',
'Type'
]