Вы можете найти его здесь , но вы просто измените свой form
. И как только вы объявляете form
, вам больше не нужно использовать fields
или exclude
при объявлении formset
, потому что все это должно быть установлено в вашем form
class EnteriesForm(ModelForm):
unit_price = forms.FloatField(widget=forms.TextInput(
attrs={
'class':'product_price',
}
))
class Meta:
model = Enteries
exclude = ()
help_texts = {
'unit_price': '<b>Click on arrow for calendar</b>',
}
EnteriesFormSet = inlineformset_factory(
Supplier,
Enteries,
# this is where you select what form you want to use:
form=EntriesForm,
# 'uploaded_by' is not even apart of this form.
# You should remove this.
# exclude=['uploaded_by'],
# 'extra': default is '1', so you don't really need this.
# extra=1
)
Вы действительно должны вернуться и прочитать всю информацию по formsets
. Наследование: formset
-> modelformset
-> inlineformset
, поэтому все, что относится к formset
, относится к inlineformset
.