Skip to content

Instantly share code, notes, and snippets.

@filipemanuelofs
Created May 6, 2013 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipemanuelofs/5525763 to your computer and use it in GitHub Desktop.
Save filipemanuelofs/5525763 to your computer and use it in GitHub Desktop.
class HomeView(ListView):
model = Evento
template_name = 'home.html'
def get_context_data(self, **kwargs):
context = super(HomeView, self).get_context_data(**kwargs)
context['palestra_list'] = Palestra.objects.filter(publico=True)
context['evento_list'] = Evento.objects.all().order_by('-criado_em')[:1]
context['geo_list'] = Local.objects.all()
return context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment