properties = [prop for prop in dir(SomeClass) if not prop.startswith('__')]
obj = {}
for prop in properties:
    obj[prop] = getattr(myinstance, prop)
How can I introspect properties and model fields in Django?