Closed jeffkala closed 1 month ago
How do we determine what is a filter vs. what is a "helper" such as include
? I briefly started looking into this and quickly realized that I was converting the all()
method to be the same as filter()
. If we pass all the kwargs, then it's essentially a replica of filter()
. If we limit it to things like include
, then how do we keep track of those special kwargs?
We discussed this internally, and we came to the conclusion that we don't believe .all()
and .filter()
need to be bespoke methods any longer. Both methods call the same endpoint, but one has a distinct list of query params allowed and the other allows any params. As the Nautobot API evolves, where do we draw the line on what kwargs we allow in .all()
?
We think the best route is to convert .all()
to just call .filter()
behind the scenes and pass along any kwargs. We will continue to accept .all()
for backwards compatibility, but functionally they would be the same.
Today if you want to pull back all devices and include config_context data you must use the
.filter
call.In the .all() call if you include the
include
kwarg it will failWorkaround is to use
.filter(include=["config_context"])
with no other filtering criteria.