#24287: A model outside an app causes inane error
----------------------------------------------+--------------------
Reporter: jMyles | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 1
----------------------------------------------+--------------------
To reproduce:
Create a models.py in the root of a project (ie, next to manage.py).
Create a class in it that inherits from django.db.models.Model.
This causes IndexError to be raised in the __new__ because
package_components will be only ['models'], without the app name, ie, this
line:
kwargs = {"app_label": package_components[app_label_index]}
Of course, the proper thing to do is to create an app, but new users may
not realize this and, given this error, may not know on what topic to seek
assistance.
--
Ticket URL: <https://code.djangoproject.com/ticket/24287>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.d80c65459a395712b12e09717228ae38%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.