Skip to content

Commit

Permalink
fix kHanYu importing
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Jun 5, 2017
1 parent 8cf4fd6 commit 357a5ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion unihan_db/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .util import merge_dict

UNIHAN_FILES = [
'Unihan_DictionaryIndices.txt',
'Unihan_DictionaryLikeData.txt',
'Unihan_IRGSources.txt',
'Unihan_NumericValues.txt',
Expand All @@ -20,7 +21,7 @@
'kAccountingNumeric', 'kCangjie', 'kCantonese', 'kCheungBauer',
'kCihaiT', 'kCompatibilityVariant', 'kDefinition', 'kFenn',
'kFourCornerCode', 'kFrequency', 'kGradeLevel', 'kHDZRadBreak',
'kHKGlyph', 'kHangul', 'kHanyuPinlu', 'kHanyuPinyin',
'kHKGlyph', 'kHangul', 'kHanyuPinlu', 'kHanYu', 'kHanyuPinyin',
'kJapaneseKun', 'kJapaneseOn', 'kKorean', 'kMandarin',
'kOtherNumeric', 'kPhonetic', 'kPrimaryNumeric',
'kRSAdobe_Japan1_6', 'kRSJapanese', 'kRSKanWa', 'kRSKangXi',
Expand Down
8 changes: 4 additions & 4 deletions unihan_db/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def import_char(c, char):
for defi in char['kHanYu']:
k = kHanYu()
k.locations.append(UnhnLocation(
volume=loc['volume'],
page=loc['page'],
character=loc['character'],
virtual=loc['virtual'],
volume=defi['volume'],
page=defi['page'],
character=defi['character'],
virtual=defi['virtual'],
))
c.kHanYu.append(k)
1 change: 1 addition & 0 deletions unihan_db/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Unhn(Base):
kCantonese = relationship("kCantonese", back_populates="char")
kMandarin = relationship("kMandarin", back_populates="char")
kHanyuPinyin = relationship("kHanyuPinyin", back_populates="char")
kHanYu = relationship("kHanYu", back_populates="char")


class kDefinition(Base):
Expand Down

0 comments on commit 357a5ad

Please sign in to comment.