本文整理匯總了Python中wikilife_utils.date_utils.DateUtils.get_time方法的典型用法代碼示例。如果您正苦於以下問題:Python DateUtils.get_time方法的具體用法?Python DateUtils.get_time怎麽用?Python DateUtils.get_time使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類wikilife_utils.date_utils.DateUtils
的用法示例。
在下文中一共展示了DateUtils.get_time方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: insert
# 需要導入模塊: from wikilife_utils.date_utils import DateUtils [as 別名]
# 或者: from wikilife_utils.date_utils.DateUtils import get_time [as 別名]
def insert(self, log):
"""
Create calories burned information for a user.
"""
user_id = log["user_id"]
reports_manager = self._mgrs.reports_mgr
str_date_hour = str(log["execute_time"]).rstrip("u")
str_hour = DateUtils.get_time(str_date_hour)
log_date = DateUtils.get_date(str_date_hour)
nodes_dict_list = LogNodes(log["nodes"]).get_loggables_dict_starting_with("wikilife.exercise.exercise.sport")
for node_dict in nodes_dict_list:
info = self._generate_exercise_calories_record(user_id, log["pk"], log_date, str_hour, node_dict)
if info:
reports_manager.save_exercise_calories_report(info)
開發者ID:wikilife-org,項目名稱:wikilife_processors,代碼行數:20,代碼來源:exercise_calories_burned_processor_tests.py
示例2: delete
# 需要導入模塊: from wikilife_utils.date_utils import DateUtils [as 別名]
# 或者: from wikilife_utils.date_utils.DateUtils import get_time [as 別名]
def delete(self, log):
"""
Deletes calories burned information for a user.
"""
user_id = log["user_id"]
reports_manager = self._mgrs.reports_mgr
str_date_hour = str(log["execute_time"]).rstrip("u")
str_hour = DateUtils.get_time(str_date_hour)
log_date = DateUtils.get_date(str_date_hour)
nodes_dict_list = LogNodes(log["nodes"]).get_loggables_dict_starting_with("wikilife.exercise.exercise.sport")
for node_dict in nodes_dict_list:
info = {}
info["log_id"] = int(log["pk"])
info["user_id"] = user_id
loggable_ns = log_node_dict.keys()[0]
info["node_id"] = int(loggable_node["pk"])
reports_manager.delete_exercise_calories_report(info)
開發者ID:wikilife-org,項目名稱:wikilife_processors,代碼行數:23,代碼來源:exercise_calories_burned_processor_tests.py