Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.forms.models import model_to_dict
- model_to_dict(intance, fields=[], exclude=[])
- obj = get_object_or_404(CustomModel,id=some_id)
- my_dict = obj.__dict__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement