python - Django: Converting an entire set of a Model's objects into a single dictionary - Stack Overflow

python - Django: Converting an entire set of a Model's objects into a single dictionary - Stack Overflow

167 down vote

You can also rely on django code already written ;).

from django.forms.models import model_to_dict model_to_dict(instance, fields=[], exclude=[])

你可能感兴趣的:(overflow)