blob: 850dd02ed795bd46a4dd2d2c878f23194598e3fe [file] [log] [blame]
Scott Bakerbf1610d2014-06-18 18:22:03 -07001# /opt/planetstack/core/dashboard/views/helloworld.py
2import os
3import sys
4import json
5from django.http import HttpResponse, HttpResponseServerError, HttpResponseForbidden
6from django.views.generic import TemplateView, View
7from core.models import *
8from django.forms.models import model_to_dict
9
10class ShellDataView(View):
11 url = r'^shelldata/'
12
13 def get(self, request, **kwargs):
14 allSlices = []
15 for slice in Slice.objects.all():
16 allSlices.append(model_to_dict(slice))
17
18 result = {"slices": allSlices}
19
20 return HttpResponse(json.dumps(result), mimetype='application/json')