Unaccent
This class provides a database transformation that removes accents and diacritics from strings. It functions as a bilateral transform, allowing for unaccented comparisons and lookups within database queries.
Attributes
| Attribute | Type | Description |
|---|---|---|
| bilateral | boolean = True | Indicates that the transformation can be applied to both the field and the lookup value for comparison. |
| lookup_name | string = unaccent | The identifier used in query expressions to apply the unaccent transformation. |
| function | string = UNACCENT | The database function name used to remove diacritics from strings in SQL queries. |
Constructor
Signature
def Unaccent()
Methods
unaccent()
def unaccent() - > [Transform](../../../db/models/lookups/transform.md?sid=django_db_models_lookups_transform)
Applies the PostgreSQL UNACCENT function to a field, removing diacritics and accents from characters for normalized text comparison.
Returns
| Type | Description |
|---|---|
[Transform](../../../db/models/lookups/transform.md?sid=django_db_models_lookups_transform) | A Transform object that represents the unaccented version of the input field. |