preheat_open.query.Query
- class preheat_open.query.Query(exclude=None)
Bases:
objectRepresents a query for filtering objects based on specified attributes.
- Variables:
_class (ClassVar) – The class type that the query is filtering.
- Methods:
__post_init__: Initializes the query attributes. __eq__: Checks if an object matches the query. convert_attr: Converts an attribute to the appropriate type. empty: Checks if the query has no attributes set. from_kwargs: Creates a Query object from keyword arguments.
- __init__(exclude=None)
Methods
__init__([exclude])convert_attr(value, name)Converts an attribute to the appropriate type based on the class definition.
from_kwargs([query])Creates a Query object from keyword arguments.
is_type(obj)Checks if the object is of the type specified by the query class.
isin(iterable)Checks if the query matches any element in the iterable.
Attributes
exclude- classmethod convert_attr(value, name)
Converts an attribute to the appropriate type based on the class definition.
- Parameters:
value (Any) – The value to convert.
name (str) – The name of the attribute.
- Returns:
The converted value.
- Return type:
Any
- classmethod from_kwargs(query=None, **kwargs)
Creates a Query object from keyword arguments.
- classmethod is_type(obj)
Checks if the object is of the type specified by the query class.
- Parameters:
obj (object) – The object to check.
- Returns:
True if the object is of the specified type, False otherwise.
- Return type:
bool
- isin(iterable)
Checks if the query matches any element in the iterable.
- Parameters:
iterable (Iterable) – The iterable to check against the query.
- Returns:
True if the query matches any element in the iterable, False otherwise.
- Return type:
bool