Beispiel #1
0
class NewProcessView(FGABrejaView):

    def __init__(self):
        self.api = ProcessAPI()

    def get(self, request):
        api = RecipeAPI()
        recipes = api.all()
        return render_to_response('new_process.html', locals(),
                                  context_instance=RequestContext(request))

    def post(self, request):
        recipe_id = request.POST.get('recipe_id')
        self.api.create_process(recipe_id=recipe_id)
        return redirect('home')
Beispiel #2
0
 def __init__(self):
     self.api = ProcessAPI()
Beispiel #3
0
 def get(self, request):
     api = ProcessAPI()
     processes = api.all()
     return render_to_response('home.html', locals(),
                               context_instance=RequestContext(request))
Beispiel #4
0
def get_actual_process(request):
    api = ProcessAPI()
    data = api.get_current_process()
    return HttpResponse(json.dumps(data), content_type='application/json')