Add attribute sort helper function

This commit is contained in:
JonnyWong16 2020-10-08 19:53:57 -07:00
parent 881f37f731
commit 3be9c84f2b
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 9 additions and 2 deletions

View file

@ -1236,6 +1236,14 @@ def bool_true(value, return_none=False):
return False
def sort_attrs(attr):
if isinstance(attr, (list, tuple)):
a = attr[0].split('.')
else:
a = attr.split('.')
return len(a), a
def get_attrs_to_dict(obj, attrs):
d = {}