I want to display my widget on the field at django admin when the field is readonly.
admin.py
class AudioTrackAdminInline(admin.StackedInline):
model = AudioTrack
form = AudioTrackForm
readonly_fields = ('file',)
forms.py
class AudioTrackForm(forms.ModelForm):
class Meta:
model = AudioTrack
widgets = { 'file': MediaFileInput, } # my widget
When the file is not readonly, it displays widget OK. But when i include it as readonly, i see text line. (Django does not to use my form if readonly)
How can i get it to use form even at readonly field?
or
How to display another widget if i set my field readonly?