A Django 1.1 / Python 2.7 project that I'm attempting to run on Python 3.10 / Django 4.1.
A Python related error (i.e. old import) or a django code error (i.e. missing field that's now mandatory) pops up, I fix it and rerun.
The current error, however, is coming from
django/db/models/base.py
, from this function -
def _has_contribute_to_class(value):
# Only call contribute_to_class() if it's bound.
return not inspect.isclass(value) and hasattr(value, "contribute_to_class")
I found this ticket - https://code.djangoproject.com/ticket/30309
that explains that hasattr
is unreliable, but seems to be ignored.
Has anyone encountered this issue, and managed to find a solution other than staying on Django 1.1?