Fixes: #441 - Patch ObjectSelectorView to support targeting custom objects from core custom fields#445
Fixes: #441 - Patch ObjectSelectorView to support targeting custom objects from core custom fields#445
Conversation
…rom core custom fields
|
@claude /review |
|
Claude finished @bctiemann's task in 1m 8s —— View job PR Review: Patch ObjectSelectorView for Custom Object SupportOverview: This PR monkey-patches Correctness
Code DuplicationThe
This is a minor issue — it would be worth extracting a shared helper (e.g., Test Coverage
Minor Issues
SummaryThis is a clean, targeted fix. The approach (monkey-patching in Verdict: Approve with minor suggestions — the patch is correct and safe; the duplication and test gaps are worth addressing but not blockers. |
arthanson
left a comment
There was a problem hiding this comment.
I tink this can be made into a common routine called both here and in CustomObjectListView.get_filterset_form to be DRY.
The form-building logic in _patched_get_form_class duplicates CustomObjectListView.get_filterset_form() (views.py:374-394), with two subtle
divergences: the class name uses model.__name__ here vs model._meta.object_name in the view, and NotImplementedError is silently swallowed here vs logged at debug in the view.
Fixes: #441
Fixes the issue of core Custom Fields being unable to use the Object Selector (magnifying glass) on object fields pointing to Custom Objects (this would previously raise an
ImportError).This change patches the
get_form_classandget_filterset_classmethods fromObjectSelectorViewupon load of thereadymethod in Custom Objects. The patched functions come with custom-object-awareFilterSetFormandFilterSetclasses that enable the Object Selector to work.