def formfield_for_dbfield(self, db_field, **kwargs):
    if db_field.name == 'name':
        kwargs['widget'] = MyWidget()
return super(PictureInline, self).formfield_for_dbfield(db_field, **kwargs)
How do I add a custom inline admin widget in Django?