Django Admin widget 셋팅 주의점
적용안됨 : field.widget.attrs['size'] = 5 적용됨 : field.widget = forms.TextInput(attrs={'size': 5}) def formfield_for_dbfield(self, db_field, **kwargs): field = super(ImageAdmin, self).formfield_for_dbfield(db_field, **kwargs) if db_field.name in ('lang') : field.widget = forms.TextInput(attrs={'size': 5}) #field.widget.attrs['size'] = 5 return field
2021.02.07