Django 2.1.
I have this code:
class AnswerInline(admin.StackedInline):
model = Answer
form = AnswerForm
fields = ("question_answer_type", "answer_plain")
readonly_fields = ("question_answer_type",)
def question_answer_type(self, row):
return row.question.answer_type
This works and I have new field "question_answer_type" in inline instances.
Now I want to make this field hidden. (I want use its content in JavaScript.)
I know there is forms.widgets.HiddenInput (or forms.HiddenInput ???) which I should probably use. But how to use it?