コード例 #1
0
ファイル: views.py プロジェクト: berrueta/steamy
def allnews(request):
    if request.method == 'POST':
        searchform = SearchForm(request.POST)

        if searchform.is_valid() is False:
            return HttpResponse("400 - Bad request", status=400)

        data = searchform.cleaned_data
        builder = SPARQLQueryBuilder()
        try:
            query = builder.create_query_from_form(data)
        except SPARQLQueryBuilderError, e:
            return render_to_response('debian/error.html', {'reason': e})

        processor = SPARQLQueryProcessor()
        try:
            processor.execute_sanitized_query(query)
        except SPARQLQueryProcessorError, e:
            return render_to_response('debian/error.html', {'reason': e})
コード例 #2
0
ファイル: views.py プロジェクト: nbarrientos/steamy
def allnews(request):
    if request.method == 'POST':
        searchform = SearchForm(request.POST)
        
        if searchform.is_valid() is False:
            return HttpResponse("400 - Bad request", status=400)

        data = searchform.cleaned_data
        builder = SPARQLQueryBuilder()
        try:
            query = builder.create_query_from_form(data)
        except SPARQLQueryBuilderError, e:
            return render_to_response('debian/error.html', {'reason': e})

        processor = SPARQLQueryProcessor()
        try:
            processor.execute_sanitized_query(query)
        except SPARQLQueryProcessorError, e:
            return render_to_response('debian/error.html', {'reason': e})
コード例 #3
0
ファイル: views.py プロジェクト: berrueta/steamy
def results(request):
    if request.method == 'POST':
        searchform = SearchForm(request.POST)

        if searchform.is_valid() is False:
            sparqlform = SPARQLForm()
            dict = {'search': searchform, 'sparql': sparqlform}
            return render_to_response('debian/search.html', dict)

        data = searchform.cleaned_data
        builder = SPARQLQueryBuilder()
        try:
            query = builder.create_query_from_form(data)
        except SPARQLQueryBuilderError, e:
            return render_to_response('debian/error.html', {'reason': e})

        processor = SPARQLQueryProcessor()
        try:
            processor.execute_sanitized_query(query)
        except SPARQLQueryProcessorError, e:
            return render_to_response('debian/error.html', {'reason': e})
コード例 #4
0
ファイル: views.py プロジェクト: nbarrientos/steamy
def results(request):
    if request.method == 'POST':
        searchform = SearchForm(request.POST)

        if searchform.is_valid() is False:
            sparqlform = SPARQLForm()
            dict = {'search': searchform, 'sparql': sparqlform}
            return render_to_response('debian/search.html', dict)
        
        data = searchform.cleaned_data
        builder = SPARQLQueryBuilder()
        try:
            query = builder.create_query_from_form(data)
        except SPARQLQueryBuilderError, e:
            return render_to_response('debian/error.html', {'reason': e})

        processor = SPARQLQueryProcessor()
        try:
            processor.execute_sanitized_query(query)
        except SPARQLQueryProcessorError, e:
            return render_to_response('debian/error.html', {'reason': e})