right now I'm working with this layout, multiple files with models
definitions, look an example:

project dir:
    |___app dir
             |__models (this is a package)
                  |___ __init__.py (here I import all my models: from fileX
import modelX...)
                  |___ fileX.py (here I can define for example: modelX)
                  |___ fileZ.py (here I can define another models: modelZ,
modelsA)
    |___app dir

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. In this example the __init__.py file would
look like this:

from fileX import modelX
from fileZ import modelZ, modelA

sorrey for my english, it's not so good.



On 7/12/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
>
>
> On 7/12/07, LaundroMat <[EMAIL PROTECTED]> wrote:
> ...
> > I don't exactly see what you'd want to do this though. It's a lot
> > easier to stick to the standard.
>
> Perhaps he's using a source control system with pessimistic locking.
>
> So, yeah, you can do this:
>
> app_dir/
>   models.py -> "from sub_model import *"
>   sub_model.py -> define some models here.
>
> The important thing, though, is that your models need to be accessible
> as app_dir.models.*; Django makes that pathing assumption right now.
> There's some desire, but no urgency, to remove that limitation.
>
> For now, just use import *.  :)
>
> >
>


-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to