Skip to content

Commit

Permalink
function for getting only groups from report
Browse files Browse the repository at this point in the history
  • Loading branch information
Karolis Rusenas committed Aug 18, 2015
1 parent 35a28c9 commit ca99fdc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions utilities/sfclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ def get_billability_report(self, report_id):
employee_dict=employee_key_dict)
return final_report

def get_groups(report):
if 'groupingsDown' in report:
result_dict = {}
people_groupings = report['groupingsDown']['groupings']
for people_group in people_groupings:
group_name = people_group['label']
group_key = people_group['key']
result_dict[group_key] = group_name

result_dict['T'] = 'Grand Total'
return result_dict
else:
raise KeyError("groupingsDown key was not found in your report")



def get_time_range(report):
"""
Provide date ranges. Keys should be sorted in ascending order
Expand Down

0 comments on commit ca99fdc

Please sign in to comment.