We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from pydantic import BaseModel class ZhModel(BaseModel): zh_year: str zh_month: str zh_day: str year_tiandi: str shengxiao: str def __str__(self): return f"{self.zh_year}{self.zh_month}{self.zh_day} {self.year_tiandi} ({self.shengxiao}年)" class ZhDate1(): def chinese(self): ...... return ZhModel( zh_year=zh_year, zh_month=zh_month, zh_day=zh_day, year_tiandi=year_tiandi, shengxiao=shengxiao[(self.lunar_year - 1900) % 12], )
The text was updated successfully, but these errors were encountered:
好主意,妙啊
Sorry, something went wrong.
再增加一个返回类并没有意义,如果需要天干地支和生肖的单独数据,不如直接增加类里面的属性来提供。 chinese 方法的作用就是输出中文字符串的。
新手直接用字符串分割获取chinese里面的年份,日期,生肖等信息。
No branches or pull requests
The text was updated successfully, but these errors were encountered: