Jacob Kaplan-Moss wrote:

Hm... what's the output of "django-admin sql" look like?

To simplify the example, I have taken the 'polls' app described in the tutorial, and split the two classes (Poll and Choice) into two files inside myproject/apps/polls/models/polls.py:

* polls.py containing the Poll class
* choices.py containing the Choice class

Then I modified polls/models/__init__.py to contain:

__all__ = ['polls', 'choices']

Now I run django-admin

\-($:~/prove/myproject/apps)-- django-admin.py sql polls
BEGIN;
CREATE TABLE polls_polls (
    id mediumint(9) unsigned auto_increment NOT NULL PRIMARY KEY,
    question varchar(200) NOT NULL,
    pub_date datetime NOT NULL
);
COMMIT;

The choices_choices table is not there.

I am missing something, but I have no idea what...

L.

Reply via email to