Hi,

the default field for a formset in admin is the AdminDateWidget, but i
need to use a custom widget and pass the localize=True parameter to
the field,  but I cant find where I need to override the field, this
is what ive got but no effect:

class BaseTrabajadorSucursalInlineFormSet(BaseInlineFormSet):
    def __init__(self, *args, **kwargs):
        super(BaseTrabajadorSucursalInlineFormSet,
self).__init__(*args, **kwargs)
        self.can_delete = False

    class Meta:

        widgets = {
            'fecha_ingreso': forms.TextInput({'class':'tipo_fecha'}),
        }



class BaseSucursalMercaderiaInlineFormSet(BaseInlineFormSet):
    def __init__(self, *args, **kwargs):
        super(BaseSucursalMercaderiaInlineFormSet,
self).__init__(*args, **kwargs)
        self.can_delete = False
TrabajadorSucursalInlineFormSet = modelformset_factory(Trabajador,
 
form=TrabajadorSucursalForm,formset=BaseTrabajadorSucursalInlineFormSet)

and then in admin.py


class TrabajadorSucursalInline(admin.TabularInline):
    model = SucursalTrabajador
    readonly_fields = ['sucursal']
    formset = TrabajadorSucursalInlineFormSet
    fieldsets = (
        ('Trabajador en Sucursal',{
            'fields' : ('sucursal','fecha_ingreso','estado',
                        )
            },),
    )
    extra = 0
    max_num=0


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to