Hello.

In an app I'm working on I have a package which contains an arbitrary
number of modules, each of which is expected to contain several django
models. In each module, the models have the same name, but they are
nested in an outer class, which I assume shouldn't cause problems.
However, it does. In my whittled down example, model PluginLite.Job is
somehow assigned PluginPlus.Job. Problem seems to go away when Jobs
don't extend models.Model

#capabilities/__init__.py:
__all__ = ['PluginPlus','PluginLite']

from django.conf import settings
if not settings.configured:
    settings.configure(
        DATABASE_ENGINE = 'sqlite3',
        DATABASE_NAME = 'db.sqlite',
        DATABASE_USER = '',
        DATABASE_PASSWORD = '',
        DATABASE_HOST = '',
        DATABASE_PORT = '',
        TIME_ZONE = '',
        )
import capabilities
from capabilities import *
print
'PluginLite.PluginLite.Job:',capabilities.PluginLite.PluginLite.Job
# import capabilities and this prints out <class
'capabilities.PluginPlus.Job'>


#capabilities/PluginLite.py
from django.db import models

class PluginLite:
        class Job(models.Model):
            class Meta:
                db_table = 'PluginLite_Job'

        class WorkUnit(models.Model):
            class Meta:
                db_table = 'PluginLite_WorkUnit'



#capabilities/PluginPlus.py
from django.db import models

class PluginPlus:
        class Job(models.Model):
            class Meta:
                db_table = 'PluginPlus_Job'

        class WorkUnit(models.Model):
            class Meta:
                db_table = 'PluginPlus_WorkUnit'

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to