mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Add attribute sort helper function
This commit is contained in:
parent
881f37f731
commit
3be9c84f2b
2 changed files with 9 additions and 2 deletions
|
@ -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 = {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue