Package: django-jp-birthday
django-jp-birthdaydjango-jp-birthday is a django's model for use Japanese birthdays and ages.Based library ishttps://github.com/bashu/django-birthday.Authored byshimakaze_softand some greatcontributorsFeaturesConverting Birthdays to Japanese StyleGet all birthdays in the specified Japanese calendarCalculate age based on birthdayGet the zodiacYears of the Japanese eraGet all user profiles within the next 30 daysGet all user profiles which have their birthday todayorder the user profiles according to their birthdayInstallationpypi$pipinstalldjango-jp-birthday

$pythonsteup.pyinstallUsagedjango-jp-birthday provides ajp_birthday.models.BirthdayModelmodel type which is a subclass of django.db.models.Model and thus has the same characteristics as that.jp_birthday.managers.JpBirthdayManageris used as a manager forjp_birthday.models.BirthdayModeland provides various methods.fromjp_birthday.modelsimportBirthdayModelclassModelsTest(BirthdayModel):classMeta:app_label='jp_birthday'ordering=('pk',)Converting Birthdays to Japanese Style# id: 1# ["2001-01-01"]m=ModelTest.objects.filter(id=1).first()birthday=m.get_jp_era_birthday()# h-13-1-1birthday=m.get_jp_era_birthday(True)# {'era': 'heisei', 'era_short': 'h', 'era_jp': 'へいせい', 'era_kanji': '平成', 'year': 13, 'month': 1, 'day': 1}Get all birthdays in the specified Japanese calendar# ["2001-01-01", "2000-01-02", "2002-12-31", "1980-03-01"]birthdays=ModelTest.objects.get_jp_era_birthdays("heisei")# ["2001-01-01", "2000-01-02", "2002-12-31"]birthdays=ModelTest.objects.get_jp_era_birthdays("へいせい")# ["2001-01-01", "2000-01-02", "2002-12-31"]Calculate age based on birthday# id: 1# ["1995-01-05"]m=ModelTest.objects.filter(id=1).first()birthday=m.get_age()# 27Get the zodiac# ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"]# id: 1# ["1995-01-05"]m=ModelTest.objects.filter(id=1).first()birthday=m.get_zodiac()# 亥Years of the Japanese era# id: 1# ["1995-01-05"]m=ModelTest.objects.filter(id=1).first()birthday=m.get_jp_era_years()# 31Get all user profiles within the next 30 days# ["2001-01-01", "2000-01-02", "2002-12-31"]jan1=date(year=2010,month=1,day=1)birthdays=ModelsTest.objects.get_upcoming_birthdays(after=jan1)# ["2001-01-01", "2000-01-02"]Get all user profiles which have their birthday today# ["2001-01-01", "2000-01-02", "2002-12-31", "1990-03-01", "1990-01-01"]jan1=date(year=2010,month=1,day=1)birthdays=ModelsTest.objects.get_birthdays(jan1)# ["2001-01-01", "1990-01-01"]Order the user profiles according to their birthday# ["2001-01-01", "2000-01-02", "2002-12-31", "1990-03-01"]jan1=date(year=2010,month=1,day=1)birthdays=ModelsTest.objects.order_by_birthday()# ["2001-01-01", "2000-01-02", "1990-03-01", "2002-12-31"]DocsDocumentation:https://django-jp-birthday.readthedocs.io.Licensedjango-jp-birthdayis released under the MIT license.HISTORYv0.7.0(2022-02-09)Full Changelogv0.6.0(2022-02-09)Full ChangelogMerged pull requests:v0.6.0#51(github-actions[bot])version 0.6をリリース#50(shimakaze-git)get_jp_era_rangeを追加.#49(shimakaze-git)Feature/fix gh actions#48(shimakaze-git)v0.4.0(2022-02-08)Full ChangelogMerged pull requests:v0.4.0#47(github-actions[bot])バージョン4.0をデプロイ#46(shimakaze-git)干支を表示する機能を作成.#45(shimakaze-git)v0.3.0(2022-02-07)Full ChangelogMerged pull requests:v0.3.0#44(github-actions[bot])0.3.0にアップデート#43(shimakaze-git)Versionを0.2.3にする#41(shimakaze-git)v0.2.0(2022-02-07)Full ChangelogClosed issues:Initial Update#30Merged pull requests:v0.2.0#40(github-actions[bot])Versionを0.2にアップロード.#39(shimakaze-git)v0.1.5#37(github-actions[bot])fix: git pushの処理を追加.#36(shimakaze-git)v0.1.5(2022-01-29)Full ChangelogMerged pull requests:v0.1.5#35(github-actions[bot])develop to master.#34(shimakaze-git)v0.1.4(2022-01-29)Full ChangelogMerged pull requests:v0.1.4#33(github-actions[bot])0.1.4にバージョンアップ.#32(shimakaze-git)Config file for pyup.io#31(pyup-bot)v0.1.3#29(github-actions[bot])fix: templateを修正していく.#28(shimakaze-git)[v0.1.3] (2022-01-29)#27(github-actions[bot])fix: add HISTORY.rstを削除していく.#26(shimakaze-git)[v0.1.3] (2022-01-29)#25(github-actions[bot])develop to master#24(shimakaze-git)v0.1.3(2022-01-28)Full ChangelogMerged pull requests:v0.1.3#23(github-actions[bot])develop to master.#22(shimakaze-git)v0.1.3#21(github-actions[bot])0.1.3に変更#20(shimakaze-git)Develop to Master.#18(shimakaze-git)refactor: プルリク先をreleaseに変更.#16(shimakaze-git)Develop to Master#15(shimakaze-git)Develop#14(shimakaze-git)fix: ワークフローの環境変数を色々表示させる.#12(shimakaze-git)fix: master-prを修正する.#11(shimakaze-git)fix: ci周りとreleaseのブランチを変更.#10(shimakaze-git)feat: ciを追加して整備する.#9(shimakaze-git)release 0.1#8(shimakaze-git)一度templateを取り込む.#2(shimakaze-git)*This Changelog was automatically generated bygithub_changelog_generator