#24059: app_label not handled when set to the same project name in all the
django
app
----------------------------+--------------------
Reporter: foxmask | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------
Here is the process to follow :
{{{
(django-bugs)foxmask@foxmask:~/Django-VirtualEnv/django-bugs/ django-admin
startproject foobar
(django-bugs)foxmask@foxmask:~/Django-VirtualEnv/django-bugs/ django-admin
startapp foxmask
}}}
in the '''models''' of foobar project :
{{{#!python
# -*- coding: utf-8 -*-
from django.db import models
class Foobarmodel(models.Model):
tag = models.CharField(max_length=80, blank=True)
url = models.URLField(max_length=255)
title = models.CharField(max_length=80, blank=True)
class Meta:
app_label = 'foobar'
}}}
in the '''models''' of foxmask app :
{{{#!python
# -*- coding: utf-8 -*-
from django.db import models
from foobar.models import Foobarmodel
class Pocket(Foobarmodel):
content = models.CharField(max_length=80, blank=True)
class Meta:
app_label = 'foobar'
}}}
in the '''settings.py''' of foobar project of course :
{{{#!python
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'foobar',
'foxmask',
)
}}}
then
{{{
(django-bugs)foxmask@foxmask:~/Django-VirtualEnv/django-bugs/foobar$
./manage.py migrate
Operations to perform:
Synchronize unmigrated apps: foobar
Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
Creating tables...
Creating table foobar_foobarmodel
Creating table foobar_pocket
Installing custom SQL...
Installing indexes...
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying sessions.0001_initial... OK
}}}
to check, i do it again
{{{
(django-bugs)foxmask@foxmask:~/Django-VirtualEnv/django-bugs/foobar$
./manage.py migrate
Operations to perform:
Synchronize unmigrated apps: foobar
Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
Creating tables...
Installing custom SQL...
Installing indexes...
Running migrations:
No migrations to apply.
}}}
I modify the '''models''' of foxmask to :
{{{#!python
# -*- coding: utf-8 -*-
from django.db import models
from foobar.models import Foobarmodel
class Pocket(Foobarmodel):
content = models.CharField(max_length=800, blank=True)
class Meta:
app_label = 'foobar'
}}}
then :
{{{
(django-bugs)foxmask@foxmask:~/Django-VirtualEnv/django-bugs/foobar$
./manage.py makemigrations
No changes detected
}}}
The fact is that if my app_label in the foxmask app is set to something
else to "foobar" ; everything goes fine
But I need to set it to foobar in all the django app I provide to maintain
consistency in the name of the table that django generates
--
Ticket URL: <https://code.djangoproject.com/ticket/24059>
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/050.e9995bc8c61d2afde782e6e2e328227f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.