File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1- # TODO : check if we can improve this by using the overwritten __add__ method
21def add_customer_name_to_projects (projects , customers ):
2+ """
3+ Add attribute customer_name in project model, based on customer_id of the
4+ project
5+ :param (list) projects: projects retrieved from project repository
6+ :param (list) customers: customers retrieved from customer repository
7+
8+ TODO : check if we can improve this by using the overwritten __add__ method
9+ """
310 for project in projects :
411 for customer in customers :
512 if project .customer_id == customer .id :
613 setattr (project , 'customer_name' , customer .name )
714
815
916def add_project_name_to_time_entries (time_entries , projects ):
17+ """
18+ Add attribute project_name in time-entry model, based on project_id of the
19+ time_entry
20+ :param (list) time_entries: time_entries retrieved from time-entry repository
21+ :param (list) projects: projects retrieved from project repository
22+
23+ TODO : check if we can improve this by using the overwritten __add__ method
24+ """
1025 for time_entry in time_entries :
1126 for project in projects :
1227 if time_entry .project_id == project .id :
You can’t perform that action at this time.
0 commit comments