Skip to content

Instantly share code, notes, and snippets.

@ircubic
Created August 12, 2010 12:10
Show Gist options
  • Save ircubic/520867 to your computer and use it in GitHub Desktop.
Save ircubic/520867 to your computer and use it in GitHub Desktop.
def fetch_results(request, id):
"""Fetch the result for a testrun as JSON
"""
run = Testrun.objects.get(id=id)
test = {'results': [
{'path': x.test,
'result': x.result.all()[0].get_result_display() + 'ED'}
for x in run.tests.all()]}
return _json(test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment