You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's simple enough to remove the gate for fields prefixed with cr_ from DynamicGroup.exclude_filter_fields:
diff --git a/nautobot/extras/models/groups.py b/nautobot/extras/models/groups.py
index 9b88f7bfd..6cb2825b2 100644
--- a/nautobot/extras/models/groups.py+++ b/nautobot/extras/models/groups.py@@ -75,7 +75,7 @@ class DynamicGroup(OrganizationalModel):
# to dynamically change the widget if we decide we do want to support this field.
#
# Type: tuple
- exclude_filter_fields = ("q", "cf_", "cr_", "cpf_", "comments") # Must be a tuple+ exclude_filter_fields = ("q", "cf_", "cpf_", "comments") # Must be a tuple
class Meta:
ordering = ["content_type", "name"]
(END)
This allows the filter and the generated filter form to store and emit this filter value. And this will work for custom fields as well. The problem is that the current machinery for rendering forms is explicitly skipping custom fields and relationships is not uniform. So while it works because RelationshipModelFilterFormMixin is adding self.relationships to the filter form, the same is not true for CustomFieldModelFilterFormMixin.
In any case, this will be better to solve by integrating the dynamic filter field from input into the Dynamic Group edit view to align the code paths and leave this issue behind. See: #2782
As ...
Austin - Network Automation Engineer
I want ...
To be able to specify relationship associations as a part of dynamic group filter criteria
So that ...
I can use the relationships to refine the filter
I know this is done when...
I can see and use relationships defined for the specified content type when modifying the filter criteria
Optional - Feature groups this request pertains to.
Database Changes
No response
External Dependencies
No response
The text was updated successfully, but these errors were encountered: