prepare_lookup_value
Return a lookup value prepared to be used in queryset filtering.
def prepare_lookup_value(
key: string,
value: any,
separator: string =
) - > any
Return a lookup value prepared to be used in queryset filtering.
Parameters
| Name | Type | Description |
|---|---|---|
| key | string | The queryset filter key (e.g., 'id__in' or 'active__isnull') used to determine the necessary transformation logic. |
| value | any | The raw input value to be transformed, which can be a string, a list of values, or a boolean-like string. |
| separator | string = , | The character used to split the input string into a list when the key specifies an '__in' lookup. |
Returns
| Type | Description |
|---|---|
any | The processed value or list of values formatted for Django-style queryset filtering, such as a boolean for null checks or a list for membership tests. |