django-model-utils icon indicating copy to clipboard operation
django-model-utils copied to clipboard

Name conflict if tracked model has field named "instance"

Open shemigon opened this issue 10 months ago • 2 comments

Problem

If a tracked model has a field called instance, creating a instance of the model throws

TypeError: Model.__init__() got multiple values for argument 'instance'

See issue https://github.com/jazzband/django-model-utils/issues/633

Solution

Removed instance argument from the new model init method and used args[0] instead.

Commandments

  • [x] Write PEP8 compliant code.
  • [x] Cover it with tests.
  • [x] Update CHANGES.rst file to describe the changes, and quote according issue with GH-<issue_number>.
  • [x] Pay attention to backward compatibility, or if it breaks it, explain why.
  • [x] Update documentation (if relevant).

shemigon avatar May 02 '25 09:05 shemigon

Hi, are there any plans to get this change into the upstream? We are being hit with it and wondering about prospective.

livenson avatar Aug 11 '25 08:08 livenson

@livenson I'm not a maintainer of the repository. I created this PR a while ago and it's been unnoticed ever since.

shemigon avatar Aug 11 '25 16:08 shemigon