Python sqlalchemy.types 模块,DateTime() 实例源码

我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用sqlalchemy.types.DateTime()

项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:QXSConsolas    作者:qxsch    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:oa_qian    作者:sunqb    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and \
                                self.server_version_info >= (2, )
                            ) or \
                            ('interbase' in self.server_version_info and \
                                self.server_version_info >= (6, )
                            )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two  and \
                            self.__dict__.get('implicit_returning', True)
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:Flask-NvRay-Blog    作者:rui7157    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:Flask-NvRay-Blog    作者:rui7157    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:Callandtext    作者:iaora    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:python_ddd_flask    作者:igorvinnicius    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:asyncpgsa    作者:CanopyTax    | 项目源码 | 文件源码
def test_querying_table(metadata):
    """
    Create an object for test table.

    """

    # When using pytest-xdist, we don't want concurrent table creations
    # across test processes so we assign a unique name for table based on
    # the current worker id.
    worker_id = os.environ.get('PYTEST_XDIST_WORKER', 'master')
    return Table(
        'test_querying_table_' + worker_id, metadata,
        Column('id', types.Integer, autoincrement=True, primary_key=True),
        Column('t_string', types.String(60)),
        Column('t_list', types.ARRAY(types.String(60))),
        Column('t_enum', types.Enum(MyEnum)),
        Column('t_int_enum', types.Enum(MyIntEnum)),
        Column('t_datetime', types.DateTime()),
        Column('t_date', types.DateTime()),
        Column('t_interval', types.Interval()),
        Column('uniq_uuid', PG_UUID, nullable=False, unique=True, default=uuid4),
    )
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:QualquerMerdaAPI    作者:tiagovizoto    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:gardenbot    作者:GoestaO    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:flask-zhenai-mongo-echarts    作者:Fretice    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:Data-visualization    作者:insta-code1    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:micro-blog    作者:nickChenyx    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:python-flask-security    作者:weinbergdavid    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:watcher    作者:nosmokingbandit    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:Lixiang_zhaoxin    作者:hejaxian    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:flask    作者:bobohope    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:Chorus    作者:DonaldBough    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:Hawkeye    作者:tozhengxq    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:Alfred    作者:jkachhadia    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:ngx_status    作者:YoYoAdorkable    | 项目源码 | 文件源码
def initialize(self, connection):
        super(FBDialect, self).initialize(connection)
        self._version_two = ('firebird' in self.server_version_info and
                             self.server_version_info >= (2, )
                             ) or \
                            ('interbase' in self.server_version_info and
                                self.server_version_info >= (6, )
                             )

        if not self._version_two:
            # TODO: whatever other pre < 2.0 stuff goes here
            self.ischema_names = ischema_names.copy()
            self.ischema_names['TIMESTAMP'] = sqltypes.DATE
            self.colspecs = {
                sqltypes.DateTime: sqltypes.DATE
            }

        self.implicit_returning = self._version_two and \
            self.__dict__.get('implicit_returning', True)
项目:Flask_Blog    作者:sugarguo    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:annotated-py-sqlalchemy    作者:hhstore    | 项目源码 | 文件源码
def convert_bind_param(self, value, engine):
        # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
        # this one doesnt seem to work with the "emulation" mode
        return psycopg.TimestampFromMx(value)
项目:annotated-py-sqlalchemy    作者:hhstore    | 项目源码 | 文件源码
def convert_result_value(self, value, engine):
        # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
        return value
项目:annotated-py-sqlalchemy    作者:hhstore    | 项目源码 | 文件源码
def convert_bind_param(self, value, engine):
        # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
        # this one doesnt seem to work with the "emulation" mode
        return psycopg.DateFromMx(value)
项目:annotated-py-sqlalchemy    作者:hhstore    | 项目源码 | 文件源码
def convert_result_value(self, value, engine):
        # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
        return value
项目:annotated-py-sqlalchemy    作者:hhstore    | 项目源码 | 文件源码
def convert_bind_param(self, value, engine):
        # TODO: perform appropriate postgres1 conversion between Python DateTime/MXDateTime
        # this one doesnt seem to work with the "emulation" mode
        return psycopg.TimeFromMx(value)
项目:QXSConsolas    作者:qxsch    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:flasky    作者:RoseOu    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:forget    作者:codl    | 项目源码 | 文件源码
def upgrade():
    for column in ('last_fetch', 'last_refresh', 'last_delete', 'next_delete'):
        op.alter_column('accounts', column, type_=DateTime(timezone=True))
项目:forget    作者:codl    | 项目源码 | 文件源码
def downgrade():
    for column in ('last_fetch', 'last_refresh', 'last_delete', 'next_delete'):
        op.alter_column('accounts', column, type_=DateTime(timezone=False))
项目:forget    作者:codl    | 项目源码 | 文件源码
def upgrade():
    for table in ('accounts', 'oauth_tokens', 'posts', 'sessions',
                  'twitter_archives', 'mastodon_apps'):
        for column in ('created_at', 'updated_at'):
            op.alter_column(table, column, type_=DateTime(timezone=True))
项目:forget    作者:codl    | 项目源码 | 文件源码
def downgrade():
    for table in ('account', 'oauth_tokens', 'posts', 'sessions',
                  'twitter_archives', 'mastodon_apps'):
        for column in ('created_at', 'updated_at'):
            op.alter_column(table, column, type_=DateTime(timezone=False))
项目:oa_qian    作者:sunqb    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:ShelbySearch    作者:Agentscreech    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:ckanext-requestdata    作者:ViderumGlobal    | 项目源码 | 文件源码
def define_request_data_table():
    global request_data_table

    request_data_table = Table('ckanext_requestdata_requests', metadata,
                               Column('id', types.UnicodeText,
                                      primary_key=True,
                                      default=make_uuid),
                               Column('sender_name', types.UnicodeText,
                                      nullable=False),
                               Column('sender_user_id', types.UnicodeText,
                                      nullable=False),
                               Column('email_address', types.UnicodeText,
                                      nullable=False),
                               Column('message_content', types.UnicodeText,
                                      nullable=False),
                               Column('package_id', types.UnicodeText,
                                      nullable=False),
                               Column('state', types.UnicodeText,
                                      default=u'new'),
                               Column('data_shared', types.Boolean,
                                      default=False),
                               Column('rejected', types.Boolean,
                                      default=False),
                               Column('created_at', types.DateTime,
                                      default=datetime.datetime.now),
                               Column('modified_at', types.DateTime,
                                      default=datetime.datetime.now),
                               Index('ckanext_requestdata_requests_id_idx',
                                     'id'))

    mapper(
        ckanextRequestdata,
        request_data_table
    )
项目:pyetje    作者:rorlika    | 项目源码 | 文件源码
def bind_processor(self, dialect):
        datetime_datetime = datetime.datetime
        datetime_date = datetime.date
        format = self._storage_format

        def process(value):
            if value is None:
                return None
            elif isinstance(value, datetime_datetime):
                return format % {
                    'year': value.year,
                    'month': value.month,
                    'day': value.day,
                    'hour': value.hour,
                    'minute': value.minute,
                    'second': value.second,
                    'microsecond': value.microsecond,
                }
            elif isinstance(value, datetime_date):
                return format % {
                    'year': value.year,
                    'month': value.month,
                    'day': value.day,
                    'hour': 0,
                    'minute': 0,
                    'second': 0,
                    'microsecond': 0,
                }
            else:
                raise TypeError("SQLite DateTime type only accepts Python "
                                "datetime and date objects as input.")
        return process
项目:Price-Comparator    作者:Thejas-1    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:Flask-NvRay-Blog    作者:rui7157    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:Flask-NvRay-Blog    作者:rui7157    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:Callandtext    作者:iaora    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:python_ddd_flask    作者:igorvinnicius    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)
项目:webapp    作者:superchilli    | 项目源码 | 文件源码
def _compare_type_affinity(self, other):
        return other._type_affinity in (sqltypes.DateTime, sqltypes.Date)