Exemple #1
0
    def __init__(self,
                 data=None,
                 queryset=None,
                 prefix=None,
                 strict=None,
                 **kwargs):

        workspace = kwargs.pop('workspace')

        super(ContatoAgrupadoPorGrupoFilterSet,
              self).__init__(data=data,
                             queryset=queryset,
                             prefix=prefix,
                             strict=strict,
                             **kwargs)

        c1_row1 = to_row([
            ('municipio', 7),
            ('grupo', 7),
            ('ativo', 7),
        ])

        col1 = Fieldset(
            _('Informações para Seleção de Contados'), c1_row1,
            to_row([(SubmitFilterPrint('filter',
                                       value=_('Filtrar'),
                                       css_class='btn-default pull-right',
                                       type='submit'), 12)]))

        col2 = Fieldset(
            _('Inf p/ Impressão'),
            SubmitFilterPrint('print',
                              value=_('Imprimir'),
                              css_class='btn-primary pull-right',
                              type='submit'))

        rows = to_row([
            (col1, 9),
            (col2, 3),
        ])

        self.form.helper = FormHelper()
        self.form.helper.form_method = 'GET'
        self.form.helper.layout = Layout(rows, )

        self.form.fields['grupo'].queryset = GrupoDeContatos.objects.filter(
            workspace=workspace)
        self.form.fields['municipio'].queryset = Municipio.objects.all()
Exemple #2
0
    def __init__(self,
                 data=None,
                 queryset=None,
                 prefix=None,
                 strict=None,
                 **kwargs):

        workspace = kwargs.pop('workspace')

        super(ContatoAgrupadoPorProcessoFilterSet,
              self).__init__(data=data,
                             queryset=queryset,
                             prefix=prefix,
                             strict=strict,
                             **kwargs)

        c1_row1 = to_row([
            ('search', 7),
            ('data', 5),
            ('importancia', 4),
            ('status', 4),
            ('classificacoes', 4),
            ('topicos', 6),
            ('assuntos', 6),
        ])

        col1 = Fieldset(
            _('Informações para Seleção de Processos'), c1_row1,
            to_row([(SubmitFilterPrint('filter',
                                       value=_('Filtrar'),
                                       css_class='btn-default pull-right',
                                       type='submit'), 12)]))

        col2 = Fieldset(
            _('Inf p/ Impressão'), 'agrupamento',
            SubmitFilterPrint('print',
                              value=_('Imprimir'),
                              css_class='btn-primary pull-right',
                              type='submit'))

        rows = to_row([
            (col1, 9),
            (col2, 3),
        ])

        self.form.helper = FormHelper()
        self.form.helper.form_method = 'GET'
        self.form.helper.layout = Layout(rows, )

        self.form.fields['search'].label = _('Filtrar Títulos de Processos')

        self.form.fields['topicos'].widget = forms.SelectMultiple(
            attrs={'size': '7'})
        self.form.fields['topicos'].queryset = TopicoProcesso.objects.all()

        self.form.fields['assuntos'].widget = forms.SelectMultiple(
            attrs={'size': '7'})
        self.form.fields['assuntos'].queryset = AssuntoProcesso.objects.filter(
            workspace=workspace)

        self.form.fields['importancia'].widget = forms.CheckboxSelectMultiple()
        # self.form.fields['importancia'].inline_class = True

        self.form.fields[
            'classificacoes'].widget = forms.CheckboxSelectMultiple()

        self.form.fields['status'].widget = forms.CheckboxSelectMultiple()
        # self.form.fields['status'].inline_class = True
        self.form.fields['status'].choices = list(
            self.form.fields['status'].choices)
        del self.form.fields['status'].choices[0]

        self.form.fields['agrupamento'].label = _('Agrupar Contatos')
        self.form.fields['agrupamento'].widget = forms.RadioSelect()
Exemple #3
0
    def __init__(self,
                 data=None,
                 queryset=None,
                 prefix=None,
                 strict=None,
                 **kwargs):

        workspace = kwargs.pop('workspace')

        super(ImpressoEnderecamentoContatoFilterSet,
              self).__init__(data=data,
                             queryset=queryset,
                             prefix=prefix,
                             strict=strict,
                             **kwargs)

        col1 = to_row([
            ('search', 6),
            ('sexo', 3),
            ('tem_filhos', 3),
            ('data_nascimento', 6),
            ('idade', 6),
            ('tipo_autoridade', 6),
            ('grupo', 6),
        ])

        col2 = to_row([
            ('impresso', 12),
            ('fontsize', 4),
            ('nome_maiusculo', 4),
            ('imprimir_pronome', 4),
            ('imprimir_cargo', 5),
            ('local_cargo', 7),
        ])

        row = to_row([
            (Fieldset(
                _('Informações para Seleção de Contatos'), col1,
                to_row([(SubmitFilterPrint('filter',
                                           value=_('Filtrar'),
                                           css_class='btn-default pull-right',
                                           type='submit'), 12)])), 6),
            (Fieldset(
                _('Informações para Impressão'), col2,
                to_row([(SubmitFilterPrint('print',
                                           value=_('Imprimir'),
                                           css_class='btn-primary pull-right',
                                           type='submit'), 12)])), 6)
        ])

        self.form.helper = FormHelper()
        self.form.helper.form_method = 'GET'
        self.form.helper.layout = Layout(row, )

        self.form.fields['search'].label = _('Nome/Nome Social/Apelido')
        self.form.fields['data_nascimento'].label = '%s (%s)' % (
            _('Aniversário'), _('Inicial - Final'))

        self.form.fields['tem_filhos'].label = _('Com filhos?')
        self.form.fields['tem_filhos'].choices[0] = (None, _('Ambos'))

        self.form.fields['imprimir_pronome'].widget = forms.RadioSelect()
        self.form.fields['imprimir_pronome'].inline_class = True

        self.form.fields['imprimir_cargo'].widget = forms.RadioSelect()
        self.form.fields['imprimir_cargo'].inline_class = True

        self.form.fields['nome_maiusculo'].widget = forms.RadioSelect()
        self.form.fields['nome_maiusculo'].inline_class = True

        self.form.fields['grupo'].queryset = GrupoDeContatos.objects.filter(
            workspace=workspace)