예제 #1
0
class Forest_park(model.Model):
    num = model.Column(model.Integer, primary_key=True)
    Province = model.Column(model.Text)
    manager = model.Column(model.Text)
    name = model.Column(model.Text)
    name_short = model.Column(model.Text)
    time = model.Column(model.String)
    area_ha = model.Column(model.String)
    county = model.Column(model.Text)
    bd_lon = model.Column(model.String)
    bd_lat = model.Column(model.String)
    lon = model.Column(model.String)
    lat = model.Column(model.String)
예제 #2
0
class Provice(model.Model):
    pid = model.Column(model.Integer,primary_key=True,autoincrement=True)
    name = model.Column(model.String(32))
    cities = model.relationship('City',backref='Provice',lazy='dynamic')
예제 #3
0
class City(model.Model):
    cid = model.Column(model.Integer,primary_key=True,autoincrement=True)
    name = model.Column(model.String(32))
    provice = model.Column(model.Integer,model.ForeignKey(Provice.pid))
    villages = model.relationship('Village', backref='City', lazy='dynamic')
예제 #4
0
class Village(model.Model):
    vid = model.Column(model.Integer, primary_key=True, autoincrement=True)
    name = model.Column(model.String(32))
    city = model.Column(model.Integer, model.ForeignKey(City.cid))
예제 #5
0
class Student(model.Model):
    id = model.Column(model.Integer, primary_key=True, autoincrement=True)
    s_name = model.Column(model.String(16))