﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24059	app_label not handled when set to the same project name in all the django app	FoxMaSk	nobody	"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 "	Bug	closed	Migrations	1.7	Normal	invalid			Unreviewed	0	0	0	0	0	0
