From e1352bcd39c0ef58ad9f75de71c5d4f8681f3e53 Mon Sep 17 00:00:00 2001 From: Lincoln de Sousa Date: Thu, 9 Aug 2007 15:51:07 -0300 Subject: [PATCH] adicionando um pouco de documentacao nessa bosta --- views.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/views.py b/views.py index 9d5d50a..6f65dfd 100644 --- a/views.py +++ b/views.py @@ -30,6 +30,19 @@ from eventmanager.conteudo.models import Noticia, Menu, Secao from eventmanager.eventos.models import * def build_response(request, template, extra={}): + """ + Shortcut to build a response based on a C{template} and build a standard + context to this template. This context contains news itens, a list of menus + and a list of sections to be shown on index. But don't worry, this context + is extensible through the C{extra} parameter. + + @param template: Contains the name of a template found in django + C{TEMPLATE_DIRS} + @type template: C{str} + + @param extra: Extra variables to be passed to the context being built. + @type extra: C{dict} + """ news = Noticia.objects.order_by('-data_criacao') menus = Menu.objects.all() index_sections = Secao.objects.filter(index=True) -- 2.20.1