Next / Previous / Contents / NM Tech homepage

6.6. The regions table

For each region code, this table gives the full name of the associated state or province, as well as the nation code, which is defined in Section 6.5, “The nations table”.

pycbc.py
    regions_table = schema.Table('regions', meta,
        schema.Column('reg_code',   types.CHAR(2), primary_key=True),
        schema.Column('reg_nation', types.CHAR(3),
            schema.ForeignKey(nations_table.c.nation_code)),
        schema.Column('reg_name',   types.VARCHAR(30)))

    class Region(object):
        def __init__(self, reg_nation, reg_code, reg_name):
            self.reg_nation = reg_nation
            self.reg_code = reg_code
            self.reg_name = reg_name
        def __repr__(self):
            return ( "<Region(%s(%s)%s)>" %
                     (self.reg_code, self.reg_nation, self.reg_name) )