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 4714 JSON serializer doesn't handle None primary keys correctly (has tests.) phil.h.smith@… Maciej Wiśniowski "Seems conceptually similar to #2894. If you serialize('json', [model]) a model with model.id == None, you will produce json containing ""pk"": ""None"" instead of ""pk"": null. The offending line seems to be in django.core.serializers.python.Serializer.end_object, around line 29, when str(obj._get_pk_val()) is called (or this is intentional and the generated ""None"" needs to be handled further down the line). Test cases attached. " closed Core (Serialization) dev fixed json serialization primary key None null Ready for checkin 1 0 0 0 0 0