Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # convert to dict
- def toDict(self):
- data = {}
- for f in self._meta.concrete_fields:
- o = f.value_from_object(self)
- if not isinstance(o, datetime.datetime):
- data[f.name] = f.value_from_object(self)
- return data
Add Comment
Please, Sign In to add comment