#24059: app_label not handled when set to the same project name in all the
django
app
----------------------------+--------------------------------------
Reporter: foxmask | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 1.7
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Changes (by shaib):
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
I suspect what you see is the documented behavior, although it may not
seem that way.
The most unintuitive point, probably, is that by setting the model's
`app_label` to `"foobar"`, you have effectively placed it in the "foobar"
app, even though the model is defined in foxmask/models.py. If you just
want to control the database table name, use `db_table`.
The next piece is that apps without a `migrations` folder are considered
"unmigrated" apps, and have the same behavior as old `syncdb` -- only new
models are added, changes in existing models are not detected; and the
project app -- which typically has no models -- does not, by default, have
migrations either.
So, by setting the `app_label` as you have, you've put your models in an
unmigrated app.
You can add migrations to the project app by running `./manage.py
makemigrations foobar`.
If you still feel there is a problem with Django's behavior here, please
ask about it on the mailing list -- see UsingTheMailingList.
--
Ticket URL: <https://code.djangoproject.com/ticket/24059#comment:1>
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/065.f5cf74ac5fbbc7efdab4160bf97f7b9b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.