我有以下关系模式(比如 MySQL,它真的在我的脑海中):
Login, Customer, Friendship, Address, Child, School
这样
Login(username, password)
Customer(id, firstName, lastName)
Friendship(customer_id, customer_id) //many to many
Address(customer_id, street, city, state, zip)
Child(id, firstName, lastName, customer_id, school_id)//each customer may have many children
School(id, name, city, state, zip)// there are many children per school
我想将架构重写为 Google App Engine 高复制数据存储 (HRD) 架构:有人知道该怎么做吗?
据我所知,这是:
class Login(db.Model):
username = db.StringProperty()
password = db.StringProperty()
class Customer(db.Model):
first_name = db.StringProperty()
last_name = db.StringProperty()
class Address(db.Model):
# what goes here?
class Friendship(db.Model):
# what goes here?
class Child(db.Model):
# what goes here?
class School(db.Model):
# what goes here?
我正在使用python 2.7。