widgets.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:diva 作者: mgriley 项目源码 文件源码
def __init__(self, description, default=relativedelta()):
        """
        default: may either be provided as a:

        * datetime.date object
        * string in ISO format (YYYY-mm-dd)
        * datetime.timedelta object. The date will be current - delta
        * dateutil.relativedelta object. The date will be current - delta

        If not specified, it will be the current date.
        Note that dateutil is not in the Python standard library. It provides a simpler
        API to specify a duration in days, weeks, months, etc. You can install it with pip.
        """
        self.description = description
        self.default = to_date_model(default)
        # see Bootstrap date picker docs for options
        # https://bootstrap-datepicker.readthedocs.io/en/stable/#
        self.attributes = {
            'data-date-format': 'yyyy-mm-dd',
            'data-date-orientation': 'left bottom',
            'data-date-autoclose': 'true',
            'value': self.default.iso(),
        }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号