#27914: makemigrations produces incorrect path for inner classes -------------------------------------+------------------------------------- Reporter: Serge van den Boom | Owner: | ChillarAnand Type: New feature | Status: closed Component: Migrations | Version: master Severity: Normal | Resolution: fixed Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by jcohen28): I am still encountering this issue when running `makemigrations` on models that include a django-enumfields EnumField. From tracing through the code, I believe the Enum is getting serialized using the django.db.migrations.serializer.TypeSerializer, which still uses the `__name__` rather than `__qualname__`. As a result, the Enum's path gets resolved to `app_name.models.enum_name` and the generated migration file throws an error "app_name.models has no 'enum_name' member". The correct path for the inner class should be `app_name.models.model_name.enum_name`. https://github.com/django/django/blob/master/django/db/migrations/serializer.py#L266 -- Ticket URL: <https://code.djangoproject.com/ticket/27914#comment:8> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.f113d0d45d923ebd913df178aff0c226%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.