views.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:gwells 作者: bcgov 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号