Skip to content

Commit

Permalink
add some sub-tables
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Jun 2, 2017
1 parent 97e7f87 commit 0b11df4
Showing 1 changed file with 54 additions and 2 deletions.
56 changes: 54 additions & 2 deletions unihan_db/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,57 @@
class Unhn(Base):
__tablename__ = 'Unhn'
id = Column(Integer, primary_key=True)
ucn = Column(String)
char = Column(String)
ucn = Column(String(8))
char = Column(String(1))
__mapper_args__ = {
'polymorphic_identity': 'char',
'polymorphic_on': type
}


class Unhn_DictionaryLikeData(Unhn):
__table__ = 'Unhn_DictionaryLikeData'

__mapper_args__ = {
'polymorphic_identity': 'dictionary-like',
}


class Unhn_IRGSources(Unhn):
__table__ = 'Unhn_IRGSources'

__mapper_args__ = {
'polymorphic_identity': 'irg-sources',
}


class Unhn_NumericValues(Unhn):
__table__ = 'Unhn_NumericValues'

__mapper_args__ = {
'polymorphic_identity': 'numeric-values',
}


class Unhn_RadicalStrokeCounts(Unhn):
__table__ = 'Unhn_RadicalStrokeCounts'

__mapper_args__ = {
'polymorphic_identity': 'radical-stroke-counts',
}


class Unhn_Readings(Unhn):
__table__ = 'Unhn_Readings'

__mapper_args__ = {
'polymorphic_identity': 'readings',
}


class Unhn_Variants(Unhn):
__table__ = 'Unhn_Variants'

__mapper_args__ = {
'polymorphic_identity': 'variants',
}

0 comments on commit 0b11df4

Please sign in to comment.