<gh_stars>1-10
from core.models import Produto
from carrinho.forms import AdicionarProdutoAoCarrinhoForm
from django.views.generic import TemplateView

# Create your views here.

class IndexView(TemplateView):
    template_name = "index.html"

    def get_context_data(self, **kwargs):
        context = super(IndexView, self).get_context_data(**kwargs)
        context['produtos'] = Produto.objects.all()
        context['form'] = AdicionarProdutoAoCarrinhoForm()

        return context


class HistoricoView(TemplateView):
    template_name = "historico.html"


StarcoderdataPython