From this question I got the idea of overriding deepycopy in my Django models. I took the code snippet from that question and put it into my model with the following signature:
def __deepcopy__(self, *args, **kwargs):
However I want to be able to pass 'field' and 'value' parameters as well, but this doesn't work. When I invoke:
deepcopy(s1, field='foo',value='bar')
with the params attempting to be pulled from the method body using kwargs['field'] and kwargs['value'], I get the following error:
File "<stdin>", line 1, in <module>
TypeError: deepcopy() got an unexpected keyword argument 'field'
By the way, I'm assuming I have to import the deepcopy method for it to be used at all, which I'm doing with:
from copy import deepcopy
There is some error in my understanding here, thanks in advance for explaining.