More info about how attribute resolution works coming soon...
A class to handle the magic of finding attributes given as arguments to columns and filters.
To use, simply instantiate the class, handing over all objects on which you want to search for the attribute, in order of preference. Then call resolve, passing the attribute and (optionally) a default value to return if the attribute was not found.
Resolve the given attribute from the available objects.
Before returning a found attribute, check if it is a method, and handle appropriately.
If the attribute is a method, return the results of calling the method.
If the attribute is a view method, return the results of calling the method (passing the QuerySet object). Note: This relies on the QuerySet having been provided to the class upon instantiation.
Resolve a dictionary.
Resolve a list.
Resolve a string.
default: A value to return if the attribute can’t be resolved.
The attribute value or the results of calling an attribute that is a method.
If those fail, return default or None.
Resolve a tuple.