Djang Admin widget 셋팅
2021. 2. 4. 00:17ㆍ파이썬/Django
formfield_overrides = {
models.CharField: {'widget': forms.TextInput(attrs={'size': 1})},
models.TextField: {'widget': forms.Textarea(attrs={'rows': 1,'cols': 15})},
models.BooleanField: {'widget': forms.CheckboxInput(attrs={'value': 12})},
}
widget 종류
'Media', 'MediaDefiningClass', 'Widget', 'TextInput', 'NumberInput',
'EmailInput', 'URLInput', 'PasswordInput', 'HiddenInput',
'MultipleHiddenInput', 'FileInput', 'ClearableFileInput', 'Textarea',
'DateInput', 'DateTimeInput', 'TimeInput', 'CheckboxInput', 'Select',
'NullBooleanSelect', 'SelectMultiple', 'RadioSelect',
'CheckboxSelectMultiple', 'MultiWidget', 'SplitDateTimeWidget',
'SplitHiddenDateTimeWidget', 'SelectDateWidget',
'파이썬 > Django' 카테고리의 다른 글
Django Admin 템플릿에서 static 사용시 주의점 (0) | 2021.02.04 |
---|---|
Django Built-in template tags and filters for문 (0) | 2021.02.04 |
Django Model ForeignKey (0) | 2021.01.31 |
Cannot assign "25": "Box.image" must be a "Image" instance. (0) | 2021.01.31 |
object has no attribute '_state' (0) | 2021.01.31 |