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.model2 import ... and for model1 and model2 you have to define: class Meta: app_label = "myappname" .... patrick On 25 Okt., 14:02, "Low Kian Seong" <[EMAIL PROTECTED]> wrote: > 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 PROTECTED]> wrote: > >> 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 as before, and syncdb should > >> be able to find them as well. > > >> TiNo > > >> On Sat, Oct 25, 2008 at 11:35 AM, Low Kian Seong <[EMAIL PROTECTED]>wrote: > > >> > 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 of files? > > >> > Thank you in advance. > > >> > lowks aat sqci.biz > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---