Allow each DataObject
subclass to define its own formfield when autoscaffolded from relation
#11079
Milestone
DataObject
subclass to define its own formfield when autoscaffolded from relation
#11079
Currently, we have the following hard-coded logic for autoscaffolding relations:
has_one
relations are autoscaffolded as one of:DropdownField
if there's less than a configurable thresholdNumericField
if there's more than a configurable thresholdFileHandleField
(usuallyUploadField
) if it's a file or imagehas_many
andmany_many
relations are autoscaffolded asGridField
fields inside a tab.Some models have specific form fields they should be used with. For example, a
Link
model might have a specificLinkField
forhas_one
andMultiLinkField
forhas_many
relations.Currently, adding the form fields for these models often requires first removing the original autoscaffolded field. It would be way better if it just autoscaffolded the correct field from the start.
We should allow each model to instantiate its own form field when being autoscaffolded from a relation.
Acceptance criteria
The text was updated successfully, but these errors were encountered: