def common_well_search(request):
"""
Returns json and array data for a well search. Used by both the map and text search.
"""
well_results = None
well_results_json = '[]'
form = SearchForm(request.GET)
if form.is_valid():
well_results = form.process()
if well_results and not len(well_results) > SearchForm.WELL_RESULTS_LIMIT:
well_results_json = json.dumps(
[well.as_dict() for well in well_results],
cls=DjangoJSONEncoder)
return form, well_results, well_results_json
评论列表
文章目录