adicionando um pouco de documentacao nessa bosta
authorLincoln de Sousa <pythonwarrior@pidinti.localdomain>
Thu, 9 Aug 2007 18:51:07 +0000 (15:51 -0300)
committerLincoln de Sousa <pythonwarrior@pidinti.localdomain>
Thu, 9 Aug 2007 18:51:07 +0000 (15:51 -0300)
views.py

index 9d5d50a..6f65dfd 100644 (file)
--- 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)