0
我想设计模式,将支持以下内容:Django的模型体系
不同类型的帐户
每个帐户都有所特有的每个账户类型
有什么喜好的多组最灵活的方式来设计模型?
例子:
Account Type Swimmer
Location
Email
ID
Preferences
Swimming
Lake
Sea
Running
Beach
Bike
Road
Account Type Doctor
Location
Email
ID
Preferences
Reading
Magazines
Food
Veggies
Account Type Runner
Location
Email
ID
Preferences
Swimming
Ocean
TV
Sports Channels
model.py
class Account (models.Model):
#common account attributes such as email, name
ACCOUNT_CHOICES = (
("swimmer", "Swimmer"),
("doctor", "Doctor"),
)
class PreferencesSwimmer(Account):
#Swimmer's Preferences
class PreferencesDoctor(Account):
#Doctor's Preferences