本文整理匯總了Python中sqlalchemy.dialects.sqlite.TIME屬性的典型用法代碼示例。如果您正苦於以下問題:Python sqlite.TIME屬性的具體用法?Python sqlite.TIME怎麽用?Python sqlite.TIME使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類sqlalchemy.dialects.sqlite
的用法示例。
在下文中一共展示了sqlite.TIME屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from sqlalchemy.dialects import sqlite [as 別名]
# 或者: from sqlalchemy.dialects.sqlite import TIME [as 別名]
def __init__(self, *args, **kwargs):
truncate_microseconds = kwargs.pop('truncate_microseconds', False)
super(TIME, self).__init__(*args, **kwargs)
if truncate_microseconds:
assert 'storage_format' not in kwargs, "You can specify only "\
"one of truncate_microseconds or storage_format."
assert 'regexp' not in kwargs, "You can specify only one of "\
"truncate_microseconds or regexp."
self._storage_format = "%(hour)02d:%(minute)02d:%(second)02d"
示例2: __init__
# 需要導入模塊: from sqlalchemy.dialects import sqlite [as 別名]
# 或者: from sqlalchemy.dialects.sqlite import TIME [as 別名]
def __init__(self, *args, **kwargs):
truncate_microseconds = kwargs.pop("truncate_microseconds", False)
super(TIME, self).__init__(*args, **kwargs)
if truncate_microseconds:
assert "storage_format" not in kwargs, (
"You can specify only "
"one of truncate_microseconds or storage_format."
)
assert "regexp" not in kwargs, (
"You can specify only one of "
"truncate_microseconds or regexp."
)
self._storage_format = "%(hour)02d:%(minute)02d:%(second)02d"