I was trying to create an m2m relationship using the 'through' parameter
I want to have an additional field in the relation table. The idea was to
The thing is that when I add the model m2m field to the 'fieldset' field at
ModelForm it throws an exception :
'HomeAdmin.fieldsets['fields']' can't include the ManyToManyField
field 'attributes' because 'attributes' manually specifies a 'through'
Apparently this is a BUG pointed out here :
Basically if you use the 'through' parameter to use a relation table that
contains an extra field/s
you can't render it using a CheckboxSelectMultple widget, not even if the
extra field allows null
I thought of fixing it this way (a nasty hack) :
foos = models.ManyToManyField('Foo')
name = CharField
And here comes the nasssty
a = ForeingKey(A)
foo = ForeingKey(Foo)
value = DateField
Here I can store the value for the relationship when saving the Model in
If anyone has a better solution, suggestion, comment or thinks this is
to make me rot in hell please let me know.
Lo unico instantaneo en la vida es el cafe, y es bien feo.