本文整理汇总了Python中location.Location.id方法的典型用法代码示例。如果您正苦于以下问题:Python Location.id方法的具体用法?Python Location.id怎么用?Python Location.id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类location.Location
的用法示例。
在下文中一共展示了Location.id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: group_locations
# 需要导入模块: from location import Location [as 别名]
# 或者: from location.Location import id [as 别名]
def group_locations(self):
"""
:return: list of locations
"""
group_locations = self._graph_db.match(start_node=self.group_node,
rel_type=GraphRelationship.LOCATED_IN,
end_node=None)
locations_list = []
for rel in group_locations:
location_dict = {}
location = Location()
location.id = rel.end_node['id']
location_dict = dict(location.location_properties)
locations_list.append(location_dict)
# locations_list.append(item.end_node["formatted_address"])
return locations_list
示例2: add_location
# 需要导入模块: from location import Location [as 别名]
# 或者: from location.Location import 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)