This should be easy and there is another question on SO that addresses the issue ( passing an argument to a custom save() method ) but that solution isn't working for me. In my view I have form.save('test string')
and in the corresponding model I have
def save(self, test, *args, **kwargs):
x = test
...
super(MyModel, self).save(*args, **kwargs)
But I keep getting save() missing 1 required positional argument: 'test'
I have tried form.save(test='test string')
but that results in save() got an unexpected keyword argument 'test'
. Finally, I changed the method signature to def save(self, *args, **kwargs)
and then in the view tried form.save({'test': 'test string'})
there is no error but nothing appears in the kwargs.
I'm using django 1.10 if that matters. Please help and thank you!