On Mon, Feb 7, 2011 at 8:28 PM, Ian Stokes-Rees <ijsto...@hkl.hms.harvard.edu> wrote: > Does it make sense that inherited models also need their apps included in > INSTALLED_APPS? Right now if I have: > > base/models.py: > > class MyBaseModel(django.db.models.Model): > stuff > > and then elsewhere: > > derived/models.py: > > class MyDerivedModel(base.MyBaseModel): > stuff > > I need to include both "derived" and "base" in my INSTALLED_APPS list in > settings.py, otherwise the table for the MyBaseModel content is never > created. It seems to me that "syncdb" should be able to "see" that > MyDerivedModel has MyBaseModel as a super class in the chain to > django.db.models.Model and consequently create the necessary tables for > MyBaseModel. > > Or have I just misunderstood why it was necessary for me to include "base" > in order to get the tables created properly by "manage.py syncdb"? > > TIA, Ian Stokes-Rees >
Explicit is better than implicit. If you want models from app 'base' installed on your system, you add the 'base' app to INSTALLED_APPS. Otherwise, its a series of $MAGIC working out what apps/DB tables are required, and $MAGIC is never good - might as well be using rails. Cheers Tom -- 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 django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.