nshafer / django-hashid-field

Django Model Field that uses Hashids to obscure the value
MIT License
370 stars 40 forks source link

values_list return string insted of HASHID object #61

Closed Arti3DPlayer closed 3 years ago

Arti3DPlayer commented 3 years ago

Model.objects.values_list("id", flat=True)

returns list of HashID objects that require additional conversion to string. Is this possible to return flat string instead ?

nshafer commented 3 years ago

For future reference (anyone that finds this issue), the Hashid object can be turned off by either setting HASHID_FIELD_ENABLE_HASHID_OBJECT = False in the Django settings, or passing enable_hashid_object=False in the Hashid*Field constructor. See README for more info.