本文整理汇总了Python中users.User.payment_id方法的典型用法代码示例。如果您正苦于以下问题:Python User.payment_id方法的具体用法?Python User.payment_id怎么用?Python User.payment_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类users.User
的用法示例。
在下文中一共展示了User.payment_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sync_from_server
# 需要导入模块: from users import User [as 别名]
# 或者: from users.User import payment_id [as 别名]
def sync_from_server(data):
# print('sync from server')
# start upload text
# print(data)
# print(data['rows_to_create'])
if int(data['rows_to_create']) > 0:
updates = data['updates']
if 'addresses' in updates:
for addresses in updates['addresses']:
address = Address()
address.address_id = addresses['id']
address.user_id = addresses['user_id']
address.name = addresses['name']
address.street = addresses['street']
address.suite = addresses['suite']
address.city = addresses['city']
address.state = addresses['state']
address.zipcode = addresses['zipcode']
address.primary_address = addresses['primary_address']
address.concierge_name = addresses['concierge_name']
address.concierge_number = addresses['concierge_number']
address.status = addresses['status']
address.deleted_at = addresses['deleted_at']
address.created_at = addresses['created_at']
address.updated_at = addresses['updated_at']
# check to see if color_id already exists and update
count_address = address.where({'address_id': address.address_id})
if len(count_address) > 0 or address.deleted_at:
for data in count_address:
address.id = data['id']
if address.deleted_at:
address.delete()
else:
address.update_special()
else:
address.add_special()
address.close_connection()
if 'cards' in updates:
for cards in updates['cards']:
card = Card()
card.card_id = cards['id']
card.company_id = cards['company_id']
card.user_id = cards['user_id']
card.profile_id = cards['profile_id']
card.payment_id = cards['payment_id']
card.root_payment_id = cards['root_payment_id']
card.street = cards['street']
card.suite = cards['suite']
card.city = cards['city']
card.state = cards['state']
card.zipcode = cards['zipcode']
card.exp_month = cards['exp_month']
card.exp_year = cards['exp_year']
card.status = cards['status']
card.deleted_at = cards['deleted_at']
card.created_at = cards['created_at']
card.updated_at = cards['updated_at']
# check to see if color_id already exists and update
count_card = card.where({'card_id': card.card_id})
if len(count_card) > 0 or card.deleted_at:
for data in count_card:
card.id = data['id']
if card.deleted_at:
card.delete()
else:
card.update_special()
else:
card.add_special()
card.close_connection()
if 'colors' in updates:
for colors in updates['colors']:
color = Colored()
color.color_id = colors['id']
color.company_id = colors['company_id']
color.color = colors['color']
color.name = colors['name']
color.ordered = colors['ordered']
color.status = colors['status']
color.deleted_at = colors['deleted_at']
color.created_at = colors['created_at']
color.updated_at = colors['updated_at']
# check to see if color_id already exists and update
count_color = color.where({'color_id': color.color_id})
if len(count_color) > 0 or color.deleted_at:
for data in count_color:
color.id = data['id']
if color.deleted_at:
color.delete()
else:
color.update_special()
else:
color.add_special()
color.close_connection()
if 'companies' in updates:
#.........这里部分代码省略.........