daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest Feb 21st, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from django.forms.models import model_to_dict
  2. model_to_dict(intance, fields=[], exclude=[])
  3.    
  4. obj = get_object_or_404(CustomModel,id=some_id)
  5. my_dict = obj.__dict__
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top