Created
November 27, 2017 18:39
-
-
Save EdMan1022/8e497e80fa6df3eafedbd821c0786e95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound | |
from voxco_survey_analysis.exceptions import InvalidUsage | |
from ..models import Analytic | |
def cluster_analysis_function(request): | |
""" | |
Perform a cluster analysis using the analysis group specified in the request | |
:param request: http request carrying the database id of the analysis group. | |
:return: JSON containing the cluster analysis data | |
""" | |
try: | |
analytic = Analytic.query.filter_by(id=int(request.args.get('analytic_id'))).one() | |
except NoResultFound: | |
raise InvalidUsage(message="No analytic exists with the given id", status_code=404) | |
except MultipleResultsFound as e: | |
raise e | |
print('ajax test') | |
return 'ajax test' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment