Re: manage.py: syncdb/sql do not pick up models from custom directory structure

2010-08-30 Thread Dan
On 30 Aug., 13:56, Daniel Roseman wrote: > In your lib/models/__init__.py, do `from FooModels import *` for each > model file. OK, that does the trick. When I import the models in lib/__init__.py they are being recognized by the manage.py script. I guess I could just look for *.py files in lib/mod

Re: manage.py: syncdb/sql do not pick up models from custom directory structure

2010-08-30 Thread Alex Robbins
If you define your models somewhere django doesn't expect, I think you need to add the app_label in the model's Meta class. http://docs.djangoproject.com/en/1.2/ref/models/options/#app-label They mention the models submodule use case in the docs. Hope that helps, Alex On Aug 30, 6:56 am, Daniel

Re: manage.py: syncdb/sql do not pick up models from custom directory structure

2010-08-30 Thread Daniel Roseman
On Aug 30, 7:46 am, Dan wrote: > On 30 Aug., 08:26, Kenneth Gonsalves wrote:> import > lib.models > > > from lib.models import * - you may get an error here > > Both commands work without giving any error messages. However they do > not actually import anything, since the models reside in sepera

Re: manage.py: syncdb/sql do not pick up models from custom directory structure

2010-08-29 Thread Dan
On 30 Aug., 08:26, Kenneth Gonsalves wrote: > import lib.models > > from lib.models import * - you may get an error here Both commands work without giving any error messages. However they do not actually import anything, since the models reside in seperate files in the models subdir and need to be

Re: manage.py: syncdb/sql do not pick up models from custom directory structure

2010-08-29 Thread Kenneth Gonsalves
On Mon, 2010-08-30 at 08:20 +0200, Daniel Klaffenbach wrote: > > The problem is that the manage.py script does not seem to be aware of > these models. I added "myproject.lib" to the INSTALLED_APPS section in > the settings file, but manage.py still cannot find any models. that is not possible. A

manage.py: syncdb/sql do not pick up models from custom directory structure

2010-08-29 Thread Daniel Klaffenbach
Hi, I am working on a pretty big application and somewhat changed the default directory structure a bit. I now have an app called "lib" in my project dir. This application contains two folders: "models" and "templatetags". The __init__.py files are present in all subdirectories. Whenever I want to