jocknerd
unread,Jul 22, 2005, 10:36:12 PM7/22/05Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-d...@googlegroups.com
I'm working on a project with a postgresql table called game. It has
basic information about a game. Then I have another table called
playoff_game which inherits the game table and adds a few extra fields.
This is done easily in postgresql. For example:
CREATE TABLE game (
game_id SERIAL PRIMARY KEY,
scheduled_date DATE,
game_date DATE,
season_id INTEGER REFERENCES season_lookup (id),
team1_id INTEGER REFERENCES school_lookup (id),
team1_score INTEGER,
team2_id INTEGER REFERENCES school_lookup (id),
team2_score INTEGER,
attendance INTEGER,
location TEXT NOT NULL DEFAULT '',
team1_forfeit BOOLEAN DEFAULT 'N',
team2_forfeit BOOLEAN DEFAULT 'N',
district_game BOOLEAN DEFAULT 'Y',
notes TEXT
);
CREATE TABLE playoff_game (
playoff_type_id INTEGER REFERENCES playoff_type_lookup (id),
region_id INTEGER REFERENCES region_lookup (id),
classification_id INTEGER REFERENCES classification_lookup (id)
) INHERITS (game)
How would I implement this in django using models?