Created
January 11, 2017 11:40
-
-
Save fchevitarese/2c3fba7a61bdb2a020ada40ec4ff57fc to your computer and use it in GitHub Desktop.
indexView2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class indexView2(ListView): | |
queryset = Post.objects.order_by('-data') | |
template_name = "post_list.html" | |
paginate_by = 3 | |
def form_valid(self, form): | |
# Faça sua lógica aqui | |
return super(DenunciaMixin, self).form_valid(form) | |
def get_context_data(self, **kwargs): | |
# Aqui você pode adicionar outras coisas no contexto. | |
context = super(indexView2, self).get_context_data(**kwargs) | |
context['form'] = ContatoForm | |
return context | |
def get_success_url(self, **kwargs): | |
return redirect(reverse('post_list')) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment