本文整理汇总了Python中models.Location.getDataNames方法的典型用法代码示例。如果您正苦于以下问题:Python Location.getDataNames方法的具体用法?Python Location.getDataNames怎么用?Python Location.getDataNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Location
的用法示例。
在下文中一共展示了Location.getDataNames方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: render_search
# 需要导入模块: from models import Location [as 别名]
# 或者: from models.Location import getDataNames [as 别名]
def render_search():
create_whoosh_dir()
rest_ix = get_restaurant_index()
loc_ix = get_location_index()
cat_ix = get_category_index()
restSearchableFields = ["name","phonenum"]
locSearchableFields = ["address","neighborhood", "zipcode"]
catSearchableFields = ["name"]
restDataList = []
locDataList = []
catDataList = []
if request.method == 'POST':
search_query = request.form['search']
restDataList = search_results(rest_ix, search_query, restSearchableFields)
locDataList = search_results(loc_ix, search_query, locSearchableFields)
catDataList = search_results(cat_ix, search_query, catSearchableFields)
constructRelatedModels(restDataList, locDataList, catDataList)
return render_template('search_results.html',
restDataNames=Restaurant.getDataNames() + ["context"],
restDataList=restDataList,
locDataNames=Location.getDataNames() + ["context"],
locDataList=locDataList,
catDataNames=Category.getDataNames() + ["context"],
catDataList=catDataList)
示例2: render_location
# 需要导入模块: from models import Location [as 别名]
# 或者: from models.Location import getDataNames [as 别名]
def render_location():
tableDataDict = getTableDataDict("Locations","location", Location)
locDataDictList = getDataDictList(getModels(Location, tableDataDict['offset'],
tableDataDict['sortby'], tableDataDict['direction']))
return render_template('template_db.html',
dataNames=Location.getDataNames(),
dataList=locDataDictList,
**tableDataDict
)
示例3: test_get_data_names_1
# 需要导入模块: from models import Location [as 别名]
# 或者: from models.Location import getDataNames [as 别名]
def test_get_data_names_1(self):
self.assertEqual(Location.getDataNames(), ["id", "address", "neighborhood", "zipcode", "latitude", "longitude"])
示例4: test_get_data_names_2
# 需要导入模块: from models import Location [as 别名]
# 或者: from models.Location import getDataNames [as 别名]
def test_get_data_names_2(self):
self.assertEqual(Location.getDataNames()[0], "id")
示例5: test_get_data_names_0
# 需要导入模块: from models import Location [as 别名]
# 或者: from models.Location import getDataNames [as 别名]
def test_get_data_names_0(self):
self.assertEqual(len(Location.getDataNames()), 6)