﻿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
18686	Models with same name and common subpackage name clash	jason.yates@…	nobody	"In the following example, Test is an empty model declared in both base/a/test/models.py and base/b/test/models2.py:

{{{
from base.a.test.models import Test
from base.b.test.models2 import Test as Test2

Test.__module__ # prints com.a.test.models
Test2.__module__ # prints com.a.test.models, but should print base.b.test.models2
}}}


It appears that the commonly named 'test' subpackage in both 'base.a' and 'base.b' is the issue. Renaming either subpackage causes the issue to disappear.


{{{
# models.py/models2.py
from django.db import models
class Test(models.Model): pass
}}}

"	Uncategorized	closed	Database layer (models, ORM)	1.3	Normal	duplicate			Unreviewed	0	0	0	0	0	0
