Skip to content

Can't add change_reason field to the admin form #853

Open
@jorguerra

Description

I don't know how to add the change reason field in the admin form.
I have followed the instructions adding SIMPLE_HISTORY_HISTORY_CHANGE_REASON_USE_TEXT_FIELD=True to the settings.py file.

I also tried defining a model like this.

from django import forms
from .models import Identity

class IdentityForm(forms.ModelForm):
  class Meta:
    model = Identity
    fields = ['type', 'country', '_change_reason'] #Also tried with 'history_change_reason'   

But I got an error saying that the field _change_reason couldn't be found. Unknown field(s) (change_reason) specified for Identity

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions