You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.0 KiB
30 lines
1.0 KiB
from django.forms import ChoiceField, DecimalField, FileField, IntegerField, ModelForm, ModelMultipleChoiceField
|
|
from controle.models import Boleto, Cliente, Pessoa, TelefoneCliente
|
|
from django.forms import inlineformset_factory
|
|
|
|
|
|
class ClienteForm(ModelForm):
|
|
responsaveis = ModelMultipleChoiceField(
|
|
queryset=Pessoa.objects.all(), label='Responsáveis')
|
|
socios = ModelMultipleChoiceField(required=False,
|
|
queryset=Pessoa.objects.all(), label='Sócios')
|
|
|
|
periodo_carencia = IntegerField(required=False)
|
|
valor_carencia = DecimalField(required=False)
|
|
porcentagem_carencia = DecimalField(required=False)
|
|
# periodicidade_boletos = ChoiceField(required=False)
|
|
contrato = FileField(
|
|
label='Escolha Arquivo:',
|
|
help_text='max. 42 megabytes'
|
|
)
|
|
|
|
class Meta:
|
|
model = Cliente
|
|
fields = '__all__'
|
|
|
|
|
|
TelefoneFormSet = inlineformset_factory(
|
|
Cliente, TelefoneCliente, exclude=[], extra=1)
|
|
|
|
BoletoFormSet = inlineformset_factory(
|
|
Cliente, Boleto, exclude=[], extra=0)
|