Open amyasnikov opened 4 months ago
Thank you for your interest in helping improve NetBox. Making life easier for plugin developers is important to us too.
My role at this stage is just to triage; others on the team with deeper understanding of the factors in play will need to take a closer look to determine whether your proposal is viable with fully gamed out. I'm setting the issue's status to under review
and will raise it with the team.
Thanks for volunteering to work it through to a PR, but we ask that you please wait until you see the status move to accepted
and the issue assigned to you before doing so.
@jeffgdotorg Hi, any news on this issue?
NetBox version
v4.0.1
Feature type
Change to existing functionality
Proposed functionality
Problem NetBox 4.0 Plugin migration guide suggests using autotype_decorator to convert filtersets into strawberry filters. However, this decorator does not support a lot of existing filters (e.g.
ChoiceFilter
):This error also ruins all the work made by
autotype_decorator
for any other filters inside FilterSet. Hence, it would be very painful to handle it at the plugin side.Possible Solution Just use Dependency Injection to inject
map_strawberry_type
insideautotype_decorator
:This would allow plugin developers to supply their own
map_strawberry_type_fn
for their own filters when usingautotype_decorator
.Use case
Plugin developers will be allowed to handle arbitrary filter types by themselves:
I can make a PR if you're okay with this change
Database changes
No response
External dependencies
No response