id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 17587 serializing foreignkeys assumes value is serializable Alex Burgel nobody "in django.core.serializers.python, handle_fk_field and handle_m2m_field assume that the foreignkey value requires no conversion, i.e. value_to_string is not called. handle_fk_field sometimes does not even convert the foreignkey value to a string (line 58). if you're using custom fields whose values are not serializable, then you're given no opportunity for conversion, and in the case of json, if that value isn't a native json type, then you get an exception. the way to work around this is to write your own serializer or to use natural keys, but given that value_to_string exists, it should be used." Bug closed Core (Serialization) 1.3 Normal duplicate Alex Burgel Accepted 1 0 0 1 0 0