Skip to content

Commit

Permalink
Merge pull request #35 from shimakaze-git/master
Browse files Browse the repository at this point in the history
v0.1.5
  • Loading branch information
shimakaze-git committed Jan 29, 2022
2 parents 6e2ca4e + 61a5e2a commit 2b47d34
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
github_changelog_generator -u ${{ env.ACTOR }} \
-p ${{ env.REPOSITORY }} \
--header-label '# HISTORY' \
-t ${{ env.TOKEN }}
-t ${{ env.TOKEN }} \
--output HISTORY.md
- name: convert md to rst HISTORY.
Expand Down
2 changes: 1 addition & 1 deletion jp_birthday/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """shimakaze-git"""
__email__ = "shimakaze.soft+github@googlemail.com"
__version__ = "0.1.4"
__version__ = "0.1.5"

__copyright__ = "Copyright (C) 2020 shimakaze-git"
__license__ = "MIT"
Expand Down
20 changes: 20 additions & 0 deletions jp_birthday/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ def get_wareki_birthdays(self, wareki: str):
def get_upcoming_birthdays(
self, days=30, after=None, include_day=True, order=True, reverse=False
):
"""[summary]
Args:
days (int, optional): [description]. Defaults to 30.
after ([type], optional): [description]. Defaults to None.
include_day (bool, optional): [description]. Defaults to True.
order (bool, optional): [description]. Defaults to True.
reverse (bool, optional): [description]. Defaults to False.
Returns:
[type]: [description]
"""
# 今後の誕生日

birthdays = self.filter()
Expand Down Expand Up @@ -132,6 +144,14 @@ def get_upcoming_birthdays(
return birthdays

def get_birthdays(self, day=None):
"""[summary]
Args:
day ([type], optional): [description]. Defaults to None.
Returns:
[type]: [description]
"""
if not day:
day = date.today()

Expand Down
26 changes: 14 additions & 12 deletions jp_birthday/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@


class BaseBirthdayModel(models.Model):
"""[summary]
Args:
models ([type]): [description]
"""
"""BaseBirthdayModel"""

objects = JpBirthdayManager()
birthday = BirthdayField()
Expand Down Expand Up @@ -69,6 +65,14 @@ def _get_wareki_birthday(self) -> dict:
}

def get_wareki_birthday(self, dict_type=False) -> object:
"""get wareki birthday
Args:
dict_type (bool, optional): 辞書型で返すか文字列で返すかのフォーマト指定. Defaults to False.
Returns:
object: dictで返すか文字列で返すのどちらかになる.
"""
wareki_birthday = self._get_wareki_birthday()
if not dict_type:
wareki = wareki_birthday["era_short"]
Expand All @@ -79,10 +83,12 @@ def get_wareki_birthday(self, dict_type=False) -> object:
return wareki_birthday

def get_age(self) -> int:
"""[summary]
"""get age from birthday.
誕生日を元に年齢を割り出して返す.
Returns:
[type]: [description]
int: age.
"""
today = date.today()

Expand All @@ -98,11 +104,7 @@ def get_age(self) -> int:


class BirthdayModel(BaseBirthdayModel):
"""[summary]
Args:
BaseBirthdayModel ([type]): [description]
"""
"""BirthdayModel"""

class Meta:
abstract = True

0 comments on commit 2b47d34

Please sign in to comment.