1👍
✅
seems you are looking for this?
from django.db.models.fields import Field
f = Field()
f.get_lookups()
{'exact': <class 'django.db.models.lookups.Exact'>, 'iexact': <class 'django.db.models.lookups.IExact'>, 'gt': <class 'django.db.models.lookups.GreaterThan'>, 'gte': <class 'django.db.models.lookups.GreaterThanOrEqual'>, 'lt': <class 'django.db.models.lookups.LessThan'>, 'lte': <class 'django.db.models.lookups.LessThanOrEqual'>, 'in': <class 'django.db.models.lookups.In'>, 'contains': <class 'django.db.models.lookups.Contains'>, 'icontains': <class 'django.db.models.lookups.IContains'>, 'startswith': <class 'django.db.models.lookups.StartsWith'>, 'istartswith': <class 'django.db.models.lookups.IStartsWith'>, 'endswith': <class 'django.db.models.lookups.EndsWith'>, 'iendswith': <class 'django.db.models.lookups.IEndsWith'>, 'range': <class 'django.db.models.lookups.Range'>, 'isnull': <class 'django.db.models.lookups.IsNull'>, 'regex': <class 'django.db.models.lookups.Regex'>, 'iregex': <class 'django.db.models.lookups.IRegex'>}
Source code:
https://github.com/django/django/blob/bae053d497ba8a8de7e4f725973924bfb1885fd2/django/db/models/lookups.py#L361 – check the whole file.
There is also much older commit which might help, if you only want a static list: https://github.com/django/django/blob/d4e578d0f64971483ded49f9cae460ea174b5138/django/db/models/sql/constants.py#L11 but this one is not available for importing anymore.
Source:stackexchange.com