本文整理汇总了Python中objects.Objects.set_value方法的典型用法代码示例。如果您正苦于以下问题:Python Objects.set_value方法的具体用法?Python Objects.set_value怎么用?Python Objects.set_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类objects.Objects
的用法示例。
在下文中一共展示了Objects.set_value方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: static_update
# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import set_value [as 别名]
def static_update(address, address_dict):
try:
for (key, value) in address_dict.items():
Objects.set_value(address, key, value)
address.save()
return address
except Exception as ex:
Logs.print_current_function_name_and_line_number(ex)
return Address.get_none()
示例2: update
# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import set_value [as 别名]
def update(publish, publish_dict):
try:
for (key, value) in publish_dict.items():
Objects.set_value(publish, key, value)
publish.save()
return publish
except Exception as ex:
Logs.print_current_function_name_and_line_number(ex)
return None
示例3: update_shop
# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import set_value [as 别名]
def update_shop(shop, shop_dict):
try:
for (key, value) in shop_dict.items():
Objects.set_value(shop, key, value)
shop.save()
return shop
except Exception as ex:
Logs.print_current_function_name_and_line_number(ex)
return Shops.get_none()
示例4: update_user
# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import set_value [as 别名]
def update_user(user, user_extension_dict, user_dict):
if user_extension_dict:
try:
ue = user.userextension
for (key, value) in user_extension_dict.items():
Objects.set_value(ue, key, value)
ue.save()
except Exception as ex:
Logs.print_current_function_name_and_line_number(ex)
return Users.get_none()
if user_dict:
for (key, value) in user_dict.items():
Objects.set_value(user, key, value)
user.save()
return user
示例5: update_attribute
# 需要导入模块: from objects import Objects [as 别名]
# 或者: from objects.Objects import set_value [as 别名]
def update_attribute(publish, name, value):
Objects.set_value(publish, name, value)