mirror of
https://github.com/ansible/awx.git
synced 2026-03-31 07:45:08 -02:30
Make sure we show relative object information in the api
This commit is contained in:
@@ -255,3 +255,12 @@ def model_instance_diff(old, new):
|
||||
diff = None
|
||||
|
||||
return diff
|
||||
|
||||
def model_to_dict(obj):
|
||||
"""
|
||||
Serialize a model instance to a dictionary as best as possible
|
||||
"""
|
||||
attr_d = {}
|
||||
for field in obj._meta.fields:
|
||||
attr_d[field.name] = str(getattr(obj, field.name, None))
|
||||
return attr_d
|
||||
|
||||
Reference in New Issue
Block a user