1👍
✅
You seem to have only read half the docs. As Pierre-Jean noted above, and even linked you to the correct part of the document, you need to define the reverse function, which is get_db_prep_value
.
1👍
I think you should provide the reverse function to to_python.
Take a look at Django doc here : Converting Python objects to query value
- [Answered ]-Django: django.contrib.sites, SITE_ID, breaks app
- [Answered ]-Django error when visiting site: syntax error (admin.py, line 4)
- [Answered ]-Django + tornado | Image Upload
Source:stackexchange.com