Open hosamhamdy258 opened 1 year ago
I was able to get this working using DRF's SlugRelatedField
I added this to my model:
hashid = HashidsField(real_field_name="id")
And this to my viewset:
lookup_field = "hashid"
Finally, I changed my PrimaryKeyRelatedField on my Serializer to a SlugRelatedField:
post = SlugRelatedField(slug_field="hashid") # Whatever else you have
Could you explain how to use django-hashids with DRF correctly when trying to make post request consider this model and serialize files below
model.py
serilizers.py
this payload raises
Thanks in advance