def get(self,request,id):

        if not hasattr(request.user,'risk'):
            return redirect('/analysis/risk?next=/analysis/compare/{}'.format(id))
        portfolio = Portfolio.objects.get(id=id)
        print(id)
        print(portfolio.user.id)
        model = ModelPortfolio()
        model_id = model.recommended_portfolio(request,portfolio.user)
        id_model = model_id
        print(id)
        print(id_model)
        analysis = Analysis_portfolio()
        context1 = analysis.anlaysis_portfolio(id)
        context2 = analysis.anlaysis_portfolio(id_model)
        context = dict(owen = context1, model = context2)
        print(context)
        return render(request, self.template_name, context) 
    def get(self, request, id):

        if not hasattr(request.user, 'risk'):
            return redirect(
                '/analysis/risk?next=/analysis/compare/{}'.format(id))
        portfolio = Portfolio.objects.get(id=id)
        print(id)
        print(portfolio.user.id)
        model = ModelPortfolio()
        model_id = model.recommended_portfolio(request, portfolio.user)
        id_model = model_id
        print(id)
        print(id_model)
        analysis = Analysis_portfolio()
        context1 = analysis.anlaysis_portfolio(id)
        context2 = analysis.anlaysis_portfolio(id_model)
        context = dict(owen=context1, model=context2)
        print(context)
        return render(request, self.template_name, context)
 def get(self,request,id):
     analysis = Analysis_portfolio()
     context = analysis.anlaysis_portfolio(id)
     return render(request, self.template_name, context) 
 def get(self, request, id):
     analysis = Analysis_portfolio()
     context = analysis.anlaysis_portfolio(id)
     return render(request, self.template_name, context)