admin.py
from django import forms
from django.contrib import admin
from .models import MyModel
class MyModelForm(forms.ModelForm):
class Meta:
model = MyModel
fields = '__all__'
widgets = {
'my_field':forms.Select(choices=[
(0, '北海道'),
(1, '神奈川'),
])
}
class MyModelAdmin(admin.ModelAdmin):
form = MyModelForm
admin.site.register(MyModel, MyModelAdmin)
Djangoの管理画面で一部のinputをTextareaに変える方法