How can I turn Django Model objects into a dictionary and still have their foreign keys? [duplicate] December 4, 2023 by Tarik obj = get_object_or_404(CustomModel,id=some_id) my_dict = obj.__dict__