本文整理汇总了Python中location.Location.location_node_by_place_id方法的典型用法代码示例。如果您正苦于以下问题:Python Location.location_node_by_place_id方法的具体用法?Python Location.location_node_by_place_id怎么用?Python Location.location_node_by_place_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类location.Location
的用法示例。
在下文中一共展示了Location.location_node_by_place_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_location
# 需要导入模块: from location import Location [as 别名]
# 或者: from location.Location import location_node_by_place_id [as 别名]
def add_location(self, location_json):
"""
link user to location nodes
:param locations_place_id:
:return:
"""
#TODO exception handling
#TODO do in location and pass in the node from the actual object (better pattern)
location_place_id = location_json['id']
location = Location()
location.id = location_place_id
location_node = location.location_node_by_place_id
if not location_node:
location.set_location_properties(location_json)
location.create_location()
location_node = location.location_node_by_place_id()
user_location_relationship = Relationship(self.user_node,
GraphRelationship.LOCATED_IN,
location_node)
# try:
self._graph_db.create_unique(user_location_relationship)