Add 'readonly' attribute to fields in schema
This is needed by Afform and SearchKit to know whether a field is appropriate to show to the user.
The goal here is to add 'readonly' to all fields that should not be presented as editable on user-facing forms.
Examples of fields that should be considered "readonly"
- Contact type (theoretically could be changed, but only under special circumstances and there's an extension for that)
- ID fields
- Contact Hash
-
Custom fields marked
"is_view"
-
FK fields that are not meant to change, e.g. Email.contact_id or Participant.contact_id. (in rare circumstances this field gets updated e.g. during deduping, but it's still not something to present on a typical user-facing form, so I'd consider them
'readonly'
). -
Any auto-increment fields or autopopulated fields e.g.
'creation_date'
. - Any other fields that are typically written to programatically and not shown on forms.