Exemplo n.º 1
0
class CancelacionForm(ContratoMixin):
    class Meta:
        model = Cancelacion

    fecha = forms.DateField(widget=FutureDateWidget(), required=False,
                            initial=timezone.now().date())

    def __init__(self, *args, **kwargs):
        super(CancelacionForm, self).__init__(*args, **kwargs)
        self.helper.layout = Fieldset(u'Cancelar Contrato', *self.field_names)
Exemplo n.º 2
0
class MetaForm(FieldSetModelFormMixin):
    class Meta:
        model = Meta

    fecha = forms.DateField(widget=FutureDateWidget(), required=False,
                            initial=timezone.now().date())

    def __init__(self, *args, **kwargs):
        super(MetaForm, self).__init__(*args, **kwargs)
        self.helper.layout = Fieldset(u'Formulario de Meta', *self.field_names)
Exemplo n.º 3
0
class ContratoEmpresarialForm(FieldSetModelFormMixin):
    class Meta:
        model = Contrato
        exclude = ('cancelado',)

    vencimiento = forms.DateField(widget=FutureDateWidget)
    ultimo_pago = forms.DateTimeField(widget=DateTimeWidget(), required=False,
                                      initial=timezone.now)
    inicio = forms.DateField(widget=FutureDateWidget())

    def __init__(self, *args, **kwargs):
        super(ContratoEmpresarialForm, self).__init__(*args, **kwargs)
        self.helper.layout = Fieldset(u'Formulario de Contrato',
                                      *self.field_names)
Exemplo n.º 4
0
class ItemForm(FieldSetModelFormMixin):
    class Meta:
        model = Item
        fields = ("inventario", "plantilla", "cantidad", 'vencimiento')

    plantilla = ModelChoiceField(
        name="",
        model="",
        label="Item",
        queryset=ItemTemplate.objects.filter(
            activo=True).order_by('descripcion').all())

    vencimiento = forms.DateTimeField(widget=FutureDateWidget())

    def __init__(self, *args, **kwargs):
        super(ItemForm, self).__init__(*args, **kwargs)
        self.helper.layout = Fieldset(u'Formulario de Item Inventariado',
                                      *self.field_names)