On Wed, 2006-09-27 at 14:06 +0000, Gary Wilson wrote:
> Malcolm Tredinnick wrote:
> > When you have models in a deeper structure like this, you need to
> > explicitly tell the model what the app name is. You do this as follows:
> >
> >         class SimpleTest(models.Model):
> >           ...
> >           class Meta:
> >               app_label="appfolder"
> >
> > This isn't really documented, I realise. Sorry about that.
> 
> I tried setting up an application with a models package yesterday, and
> failed also.  Even after adding the Meta attribute, still nothing
> happens for me on a syncdb.  The output of sql <appname> is simply:
> 
> BEGIN;
> COMMIT;

You also need to have the model in the __all__ export of
models/__init__.py, otherwise it doesn't get imported into the
appropriate namespace as part of "import myapp.models".

Admittedly, it's hackish, but it is workable if you want to structure
your directories this way.

Cheers,
Malcolm


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

Reply via email to