本文整理汇总了Python中models.Place.get_owner_places方法的典型用法代码示例。如果您正苦于以下问题:Python Place.get_owner_places方法的具体用法?Python Place.get_owner_places怎么用?Python Place.get_owner_places使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Place
的用法示例。
在下文中一共展示了Place.get_owner_places方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: place_owner_list
# 需要导入模块: from models import Place [as 别名]
# 或者: from models.Place import get_owner_places [as 别名]
def place_owner_list(user_id):
"""
It retrieves the list of places for which the user is the owner.
Parameters:
- user_id: id of the user, which is owner and wants to get its own places.
Returns a tuple:
- list of Places owned by the user (empty if the user is not an owner)
- status message
- the http code indicating the type of error, if any
"""
try:
places = Place.get_owner_places(user_id)
except TypeError, e:
return None, str(e), 400