本文整理汇总了Python中karesansui.lib.checker.Checker.check_datetime_string方法的典型用法代码示例。如果您正苦于以下问题:Python Checker.check_datetime_string方法的具体用法?Python Checker.check_datetime_string怎么用?Python Checker.check_datetime_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类karesansui.lib.checker.Checker
的用法示例。
在下文中一共展示了Checker.check_datetime_string方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: validates_report
# 需要导入模块: from karesansui.lib.checker import Checker [as 别名]
# 或者: from karesansui.lib.checker.Checker import check_datetime_string [as 别名]
def validates_report(obj):
checker = Checker()
check = True
_ = obj._
checker.errors = []
if is_param(obj.input, 'report_start_day'):
check = checker.check_datetime_string(_('Start Date'),
obj.input.report_start_day,
CHECK_EMPTY | CHECK_VALID,
obj.me.languages,
) and check
if is_param(obj.input, 'report_end_day'):
check = checker.check_datetime_string(_('End Date'),
obj.input.report_end_day,
CHECK_EMPTY | CHECK_VALID,
obj.me.languages,
) and check
if is_param(obj.input, 'report_start_time'):
check = checker.check_time_string(_('Start Time'),
obj.input.report_start_time,
CHECK_EMPTY | CHECK_VALID,
) and check
if is_param(obj.input, 'report_end_time'):
check = checker.check_time_string(_('End Time'),
obj.input.report_end_time,
CHECK_EMPTY | CHECK_VALID,
) and check
obj.view.alert = checker.errors
return check
示例2: validates_log
# 需要导入模块: from karesansui.lib.checker import Checker [as 别名]
# 或者: from karesansui.lib.checker.Checker import check_datetime_string [as 别名]
def validates_log(obj):
checker = Checker()
check = True
_ = obj._
checker.errors = []
if is_param(obj.input, "s"):
check = (
checker.check_datetime_string(_("Start Date"), obj.input.s, CHECK_EMPTY | CHECK_VALID, obj.me.languages)
and check
)
if is_param(obj.input, "e"):
check = (
checker.check_datetime_string(_("End Date"), obj.input.e, CHECK_EMPTY | CHECK_VALID, obj.me.languages)
and check
)
if is_param(obj.input, "st"):
check = checker.check_time_string(_("Start Time"), obj.input.st, CHECK_EMPTY | CHECK_VALID) and check
if is_param(obj.input, "et"):
check = checker.check_time_string(_("End Time"), obj.input.et, CHECK_EMPTY | CHECK_VALID) and check
obj.view.alert = checker.errors
return check
示例3: validates_log
# 需要导入模块: from karesansui.lib.checker import Checker [as 别名]
# 或者: from karesansui.lib.checker.Checker import check_datetime_string [as 别名]
def validates_log(obj):
checker = Checker()
check = True
_ = obj._
checker.errors = []
if is_param(obj.input, 's'):
check = checker.check_datetime_string(_('Start Date'),
obj.input.s,
CHECK_EMPTY | CHECK_VALID,
obj.me.languages,
) and check
if is_param(obj.input, 'e'):
check = checker.check_datetime_string(_('End Date'),
obj.input.e,
CHECK_EMPTY | CHECK_VALID,
obj.me.languages,
) and check
if is_param(obj.input, 'st'):
check = checker.check_time_string(_('Start Time'),
obj.input.st,
CHECK_EMPTY | CHECK_VALID,
) and check
if is_param(obj.input, 'et'):
check = checker.check_time_string(_('End Time'),
obj.input.et,
CHECK_EMPTY | CHECK_VALID,
) and check
obj.view.alert = checker.errors
return check
示例4: validates_jobsearch
# 需要导入模块: from karesansui.lib.checker import Checker [as 别名]
# 或者: from karesansui.lib.checker.Checker import check_datetime_string [as 别名]
def validates_jobsearch(obj):
checker = Checker()
_ = obj._
checker.errors = []
check = True
edit = False
if is_param(obj.input, "name", True) is True:
edit = True
check = checker.check_string(
_('Machine Name'),
obj.input.name,
CHECK_LENGTH | CHECK_ONLYSPACE | CHECK_VALID,
'[%_]',
min = MACHINE_NAME_MIN_LENGTH,
max = MACHINE_NAME_MAX_LENGTH,
) and check
if is_param(obj.input, "user", True) is True:
edit = True
check = checker.check_string(
_('Create User'),
obj.input.user,
CHECK_LENGTH | CHECK_ONLYSPACE | CHECK_VALID,
'[%_]',
min = USER_MIN_LENGTH,
max = USER_MAX_LENGTH,
) and check
if is_param(obj.input, "status", True) is True:
edit = True
check = checker.check_status(
_('Status'),
obj.input.status,
CHECK_VALID,
JOBGROUP_STATUS.values()
) and check
if is_param(obj.input, "start", True) is True:
edit = True
check = checker.check_datetime_string(
_('Created'),
obj.input.start,
CHECK_VALID,
obj.me.languages
) and check
if is_param(obj.input, "end", True) is True:
edit = True
check = checker.check_datetime_string(
_('Created'),
obj.input.end,
CHECK_VALID,
obj.me.languages
) and check
obj.view.alert = checker.errors
return check, edit