Re: Breaking up models into smaller files

2008-10-25 Thread patrickk
for every model, you have to set: class Meta: app_label = "myappname" ... so, let´s say you have: /myappname/ /models/ __init__.py model1.py model2.py ... __init__.py has to look like: from myappname.models.model1 import ... from myappname.models.mode

Re: Breaking up models into smaller files

2008-10-25 Thread Low Kian Seong
How is the "app_label" used? Sparse documentation about this. On Sat, Oct 25, 2008 at 6:53 PM, patrickk <[EMAIL PROTECTED]> wrote: > > be aware that you also have to define app_label = "myapp" for every > model when using the admin-interface. > > patrick. > > > On Oct 25, 12:13 pm, TiNo <[EMAIL P

Re: Breaking up models into smaller files

2008-10-25 Thread patrickk
be aware that you also have to define app_label = "myapp" for every model when using the admin-interface. patrick. On Oct 25, 12:13 pm, TiNo <[EMAIL PROTECTED]> wrote: > They are just normal python files. So you could just create a 'models' > folder and within it an __init__.py. > so: > > - app

Re: Breaking up models into smaller files

2008-10-25 Thread TiNo
They are just normal python files. So you could just create a 'models' folder and within it an __init__.py. so: - app -- models --- __init__.py --- stocks.py etc. # __init__.py from stocks import StockModel from customers import CustomerModel etc. Now you can still use the same import commands a

Breaking up models into smaller files

2008-10-25 Thread Low Kian Seong
I am trying to build an app in django which has a few components: 1. Stocks 2. Customers and 3. Sales I noticed that my models.py is getting huge and unwieldy. I tried digging around but could not find anything good but is there a guide on properly breaking a huges models.py into smaller chunks