Ejemplo n.º 1
0
def getRelatedDisease(request):
    try:
        data = json.loads(request.body)
        try:
            token = Token.objects.filter(token=data['token']).first()
            user = token.user
        except:
            raise myError('Please Log In.')
        gene_name = data['gene_name']
        realated_disease_list = search_related_disease(gene_name)
        result = {
            'successful': True,
            'data': realated_disease_list,
            'error': {
                'id': '',
                'msg': '',
            },
        }
    except myError, e:
        result = {
            'successful': False,
            'error': {
                'id': '3',
                'msg': e.value,
            }
        }
Ejemplo n.º 2
0
def getRelatedDisease(request):
	try:
		data = json.loads(request.body)
		try:
			token = Token.objects.filter(token=data['token']).first()
			user = token.user
		except:
			raise myError('Please Log In.')
		gene_name = data['gene_name']
		realated_disease_list = search_related_disease(gene_name)
		result = {
			'successful': True,
			'data': realated_disease_list,
			'error': {
				'id': '',
				'msg': '',
			},
		}
	except myError, e:
		result = {
			'successful': False,
			'error': {
				'id': '3',
				'msg': e.value,
			}
		}
Ejemplo n.º 3
0
	def test_search_related_disease(self):
		search_result = search_related_disease('name1')
		if search_result:
			return True