I want to use TabularInline for my model-admin with a custom form and extra=3. But the problem is that when I hit save in my admin page, the form gives validation error on empty extras that I didn't use and can't save the models I wanted to create. I read the docs in django and can't quite understand the solution to my problem.
The reason I want to use a custom form is that I'm using custom widgets for some of the fields. So there may be a better solution for my needs than using a custom form which I'm not aware of. I'm using Django v2.0 and here's the code for my admin:
class BingilForm(forms.ModelForm):
class Meta:
model = Bingil
fields = '__all__'
widgets = {
'position_top': RangeInput(),
'position_left': RangeInput(),
'background_color': ColorInput(),
'foreground_color': ColorInput(),
}
class InlineVideoBingil(admin.TabularInline):
model = Bingil
fk_name = 'video'
form = BingilForm
extra = 3
show_change_link = True