[PoC] Add ability to exclude fields from automatic forms and tables #519
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a proof of concept PR for an alternative way to support excluding fields from automatic tables and forms, as seen in #517 and #416.
It adds the ability to specify the
:exclude
option when defining an automatic table or form (i.e. without a block).The advantage I see to this approach is that it confines the exclusion logic to the automatic form and table classes where it is most relevant. One disadvantage perhaps is that it is slightly harder to re-use specific exclusions between resources via adapter methods/modules.
A logical next step would be to add global configuration options for the default excluded fields (e.g.
Trestle.config.default_table_exclusions
/Trestle.config.default_form_exclusions
).