Skip to content

Change Field to TextField #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions django_hashids/field.py
Original file line number Diff line number Diff line change
@@ -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, Field
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
Expand All @@ -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)
Expand Down