As far as I can tell (please correct me if I'm wrong), the library at present does not support setting a value for ManyToManyFields on models. Ideally, I would like to be able to pass an array of values to the create endpoint to create a new object, i.e.:
$.ajax("/ajax/myapp/mymodel.json",{
data: {'foo':[1,2]}, //jquery handles converting this into the correct format as below
type: 'POST'});
=> POST /ajax/myapp/mymodel.json?foo=1&foo=2
Class MyModel(models.Model):
foo = models.ManyToManyField(MyOtherModel)
Correct, ManyToManyField's are not supported currently. This is another example of why we should probably consider a pure JSON payload over HTTP POST as well.
As far as I can tell (please correct me if I'm wrong), the library at present does not support setting a value for ManyToManyFields on models. Ideally, I would like to be able to pass an array of values to the create endpoint to create a new object, i.e.:
=> POST /ajax/myapp/mymodel.json?foo=1&foo=2