From 5b77747c61868571f38772828e24538d3bc0e046 Mon Sep 17 00:00:00 2001 From: "Diegovsky (Diego Augusto)" Date: Tue, 3 Jun 2025 15:18:34 -0300 Subject: [PATCH 1/2] Change Field to TextField --- django_hashids/field.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django_hashids/field.py b/django_hashids/field.py index a63f28f..9e7b8c3 100644 --- a/django_hashids/field.py +++ b/django_hashids/field.py @@ -1,13 +1,13 @@ from django.conf import settings from django.core.exceptions import FieldError -from django.db.models import Field +from django.db.models import TextField from django.utils.functional import cached_property from hashids import Hashids from .exceptions import ConfigError, RealFieldDoesNotExistError -class HashidsField(Field): +class HashidsField(TextField): concrete = False allowed_lookups = ("exact", "iexact", "in", "gt", "gte", "lt", "lte", "isnull") # these should never change, even when Hashids updates @@ -22,7 +22,7 @@ def __init__( salt=None, alphabet=None, min_length=None, - **kwargs + **kwargs, ): kwargs.pop("editable", None) super().__init__(*args, editable=False, **kwargs) From 782fdd8066a2185cd729fc902121a9231500f208 Mon Sep 17 00:00:00 2001 From: "Diegovsky (Diego Augusto)" Date: Thu, 17 Jul 2025 19:06:05 -0300 Subject: [PATCH 2/2] Fix crash --- django_hashids/field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_hashids/field.py b/django_hashids/field.py index 9e7b8c3..1e6d060 100644 --- a/django_hashids/field.py +++ b/django_hashids/field.py @@ -1,6 +1,6 @@ from django.conf import settings from django.core.exceptions import FieldError -from django.db.models import TextField +from django.db.models import TextField, Field from django.utils.functional import cached_property from hashids import Hashids