Last active
August 29, 2015 14:27
-
-
Save JonnatasCabral/b5f9e618c2bb434bff83 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import itertools | |
| def get_context_data(self, **kwargs): | |
| context = super(RelatorioPautaView, self).get_context_data(**kwargs) | |
| docs = Audiencia.objects.all().order_by( | |
| 'processo_dpvat__estado', 'processo_dpvat__estado') | |
| docs_mutuario = [ | |
| (tipo, [x for x in doc_list]) | |
| for tipo, doc_list in itertools.groupby( | |
| docs, lambda x: x.processo_dpvat.estado)] | |
| context['group'] = docs_mutuario | |
| return context |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment