Benjamin is right, I forgot that detail!! On 7/12/07, Benjamin Slavin <[EMAIL PROTECTED]> wrote: > > On 7/12/07, Lic. Jos� M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote: > > the idea here is like Jeremy say, make django think that it has a module > or > > package named models, here, in __init__.py file I'm telling that the > > directory models is a package and for all your models to be accessible to > > django U must import all of them. > > This is how we handle breaking apart model files for large > applications. The only thing that should be added is that you need to > explicitly define the application in the Meta class. To clarify: > > ..../foos/models/Bar.py > ================ > class Bar(models.Model): > .... > class Meta: > app_label='foos' > > This way Django will be able to recognize your model as 'foos.Bar' > (important for the Django ORM innards). > > Note: If you start to see 'module is not callable' (or similar) > errors, make sure you've added the imports to __init__.py properly. > > Hope this helps, > - Ben > > > >
-- Lic. Jos� M. Rodriguez Bacallao Cupet ----------------------------------------------------------------- Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el titanic por profesionales ----------------------------------------------------------------- --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---