本文整理汇总了Python中py2neo.Node.__primarylabel__方法的典型用法代码示例。如果您正苦于以下问题:Python Node.__primarylabel__方法的具体用法?Python Node.__primarylabel__怎么用?Python Node.__primarylabel__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py2neo.Node
的用法示例。
在下文中一共展示了Node.__primarylabel__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_character
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import __primarylabel__ [as 别名]
def get_character(message):
if message['AuctionType'] == 'request':
char_id = message['BuyerCharacterId']
char_name = message['BuyerName']
elif message['AuctionType'] == 'offer':
char_id = message['SellerCharacterId']
char_name = message['SellerName']
char_node = Node(
'Character',
Id = char_id,
Name = char_name
)
char_node.__primarylabel__ = 'Character'
char_node.__primarykey__ = 'Id'
return char_node
示例2: get_item
# 需要导入模块: from py2neo import Node [as 别名]
# 或者: from py2neo.Node import __primarylabel__ [as 别名]
def get_item(message):
group = message['ItemGroupTypeId']
enchantment = message['EnchantmentLevel']
quality = message['QualityLevel']
item_id = f"{group}@{enchantment}&{quality}"
item_node = Node(
'Item',
Id = item_id,
Group = message['ItemGroupTypeId'],
Tier = message['Tier'],
Enchantment = enchantment,
Quality = quality
)
item_node.__primarylabel__ = "Item"
item_node.__primarykey__ = 'Id'
return item_node