views.py 文件源码

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

项目:mendelmd 作者: raonyguimaraes 项目源码 文件源码
def create(request):
    print('Hello')
    filterstring = request.META['QUERY_STRING']
    print(filterstring)
    if request.method == 'POST':
        form = Filter(request.POST)        
        if form.is_valid():
            #use id for unique names
            filter = FilterAnalysis.objects.create(user=request.user)
            filter.name = request.POST['name']
            filter.filterstring = form.cleaned_data['filterstring']
            filter.save()
            #return HttpResponseRedirect('/filter_analysis/?%s' % (filter.filterstring))
            return redirect(reverse('filter_analysis')+'?'+filter.filterstring)
    else:
        form = Filter(initial={'filterstring': filterstring})

    return render(request, 'filter_analysis/createfilter.html', {'form': form})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号