misaelvf2 / pykanji

MIT License
0 stars 0 forks source link

Split Kanji readings attribute into separate kunyomi and onyomi attributes #2

Closed misaelvf2 closed 2 years ago

misaelvf2 commented 2 years ago

Our Kanji class currently has a single readings attribute, which contains both onyomi as well as kunyomi attributes.

It would be good if we could expose the onyomi and kunyomi readings as separate attributes as well.

Need to investigate the best way to implement this. We don't necessarily want to have two separate onyomi and kunyomi columns in our database schema. Is it possible to add attributes to our classes in such a way that it does not imply adding additional columns to our schema?

misaelvf2 commented 2 years ago

No longer necessary. Instead, the Kanji API endpoint returns onyomi and kunyomi readings as separate attributes. This is a better approach, because the publicly-facing API endpoints can evolve independently of the ORM/database representations of the objects.