Commit d81bffa6 authored by Nijveen, Harm's avatar Nijveen, Harm
Browse files

now added the new suggestions files

parent bbce51ee
Pipeline #2058 skipped
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
import urllib2
from django.shortcuts import render_to_response, HttpResponse
from main.models import GeneInfo, GO, Experiment
def index(request):
species_name = "Arabidopsis thaliana"
experiments = Experiment.objects.filter(species__species_name=species_name)
if request.method == 'GET':
if request.GET.get('query') and request.GET.get('experiment_name'):
query = request.GET.get('query')
query = urllib2.unquote(query).strip()
experiment_name = request.GET.get('experiment_name')
GOterms = list()
genes = list()
go_results = GO.objects.raw(
"select * from main_go WHERE MATCH (name, definition) AGAINST ('%s' IN NATURAL LANGUAGE MODE)"%query)
for GOterm in go_results:
gene_results = GeneInfo.objects.raw(
"select * from main_geneinfo WHERE MATCH (gene_name, description) AGAINST ('%s' IN NATURAL LANGUAGE MODE)"%query)
for gene in gene_results:
return render_to_response('suggestions.html', {'Genes': genes,
'GOterms': GOterms,
'experiments': experiments,
'experiment_name': experiment_name})
return render_to_response('suggestions.html', {'experiments': experiments})
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment