[SQL-CVS] SQLObject development repository branch master updated. 3.0.0a1-12-gaf5c77a
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <no...@so...> - 2015-06-17 19:34:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "SQLObject development repository". The branch, master has been updated via af5c77a11410fa315cd0fca2393ddbd17f6c4e4c (commit) via 3b63a3a1ec226a291e650ddc3d0260748ff98d83 (commit) via ed8a18d683815e19503896939a10bc5e0f3fefe5 (commit) via 5ec7fb0fbed6648c61e9e6998657b462c8b2645d (commit) via 4cea85888411aef213fc69a80efdff5e2e25e8c6 (commit) via e59e089b78b5ed3e70a9d4695f2a3265f7ccd1bc (commit) via b75adf042b0a3961b4022ab43a00c5da91d131b4 (commit) via 40077a5bb76ca5cb8b1f7eaabb5ce8c853eae5f7 (commit) via b3381c4d9fc2f0d2579a83a0a3e70e821871202e (commit) via 4384a86393b2ae832e7765cfdd0641943352d9a8 (commit) via 62c12c3c36164a981ee1430a66e285048d2d0d78 (commit) via 48cd28437ddf45eadac2bb6b503f49f869d0b995 (commit) from e3ec249ed82ea04e79cc160904bb20ef6da02ad0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://sourceforge.net/p/sqlobject/sqlobject/ci/af5c77a11410fa315cd0fca2393ddbd17f6c4e4c commit af5c77a11410fa315cd0fca2393ddbd17f6c4e4c Merge: e59e089 3b63a3a Author: Oleg Broytman <ph...@ph...> Date: Wed Jun 17 22:29:46 2015 +0300 Merge branch '2.2' diff --cc docs/News.txt index 2ad7e7f,b621e7f..dca9b9d --- a/docs/News.txt +++ b/docs/News.txt @@@ -7,36 -7,20 +7,47 @@@ New .. _start: +SQLObject 3.0.0 (master) +======================== + +Features +-------- + +* Support for Python 2 and Python 3 with one codebase! + (Python version >= 3.4 currently required.) + +Minor features +-------------- + +* Use fdb adapter for Firebird. + +* PyDispatcher (>=2.0.4) was made an external dependency. + +Development +----------- + +* Source code was made flake8-clean. + +Documentation +------------- + +* Documentation is published at http://sqlobject.readthedocs.org/ in + Sphinx format. + - SQLObject 2.1.3 + SQLObject 2.2.0 =============== + Features & Interface + -------------------- + + * Add function col.use_microseconds(True/False). Default is to use + microseconds (True). + + * For MSSQL use datetime2(6) and time(6) columns. + + Minor features + -------------- + * Minor refactoring to pave the way to Python 3 was merged from `SQLObject 1.6.7`_. diff --cc sqlobject/col.py index 7f85279,454249b..2b2ed29 --- a/sqlobject/col.py +++ b/sqlobject/col.py @@@ -27,15 -28,16 +27,16 @@@ try except ImportError: import pickle import weakref + from formencode import compound, validators -from classregistry import findClass +from .classregistry import findClass # Sadly the name "constraints" conflicts with many of the function # arguments in this module, so we rename it: -import constraints as constrs -import converters -import sqlbuilder -from styles import capword - -NoDefault = sqlbuilder.NoDefault +from . import constraints as constrs ++from . import converters +from . import sqlbuilder +from .styles import capword +from .compat import PY2, string_type, unicode_type, buffer_type import datetime datetime_available = True @@@ -71,16 -73,25 +72,35 @@@ __all__ = ["datetime_available", "mxdat if mxdatetime_available: __all__.append("MXDATETIME_IMPLEMENTATION") +default_datetime_implementation = DATETIME_IMPLEMENTATION + +if not PY2: + # alias for python 3 compatibility + long = int + # This is to satisfy flake8 under python 3 + unicode = str + +NoDefault = sqlbuilder.NoDefault + + + def use_microseconds(use=True): + if use: + SODateTimeCol.datetimeFormat = '%Y-%m-%d %H:%M:%S.%f' + SOTimeCol.timeFormat = '%H:%M:%S.%f' + dt_types = [(datetime.datetime, converters.DateTimeConverterMS), + (datetime.time, converters.TimeConverterMS)] + else: + SODateTimeCol.datetimeFormat = '%Y-%m-%d %H:%M:%S' + SOTimeCol.timeFormat = '%H:%M:%S' + dt_types = [(datetime.datetime, converters.DateTimeConverter), + (datetime.time, converters.TimeConverter)] + for dt_type, converter in dt_types: + converters.registerConverter(dt_type, converter) + + + __all__.append("use_microseconds") + + creationOrder = count() ######################################## diff --cc sqlobject/converters.py index aa08ba3,322b5d8..cddf52e --- a/sqlobject/converters.py +++ b/sqlobject/converters.py @@@ -144,17 -116,16 +144,17 @@@ def FloatConverter(value, db) registerConverter(float, FloatConverter) if DateTimeType: - def DateTimeConverter(value, db): - return "'%s'" % value.strftime("%Y-%m-%d %H:%M:%S.%s") + def mxDateTimeConverter(value, db): + return "'%s'" % value.strftime("%Y-%m-%d %H:%M:%S") - registerConverter(DateTimeType, DateTimeConverter) + registerConverter(DateTimeType, mxDateTimeConverter) - def TimeConverter(value, db): + def mxTimeConverter(value, db): return "'%s'" % value.strftime("%H:%M:%S") - registerConverter(DateTimeDeltaType, TimeConverter) + registerConverter(DateTimeDeltaType, mxTimeConverter) + def NoneConverter(value, db): return "NULL" @@@ -176,28 -146,31 +176,38 @@@ if hasattr(time, 'struct_time') registerConverter(time.struct_time, StructTimeConverter) + def DateTimeConverter(value, db): + return "'%04d-%02d-%02d %02d:%02d:%02d'" % ( + value.year, value.month, value.day, + value.hour, value.minute, value.second) + ++ + def DateTimeConverterMS(value, db): return "'%04d-%02d-%02d %02d:%02d:%02d.%06d'" % ( value.year, value.month, value.day, value.hour, value.minute, value.second, value.microsecond) - registerConverter(datetime.datetime, DateTimeConverter) + registerConverter(datetime.datetime, DateTimeConverterMS) + def DateConverter(value, db): return "'%04d-%02d-%02d'" % (value.year, value.month, value.day) registerConverter(datetime.date, DateConverter) + def TimeConverter(value, db): + return "'%02d:%02d:%02d'" % (value.hour, value.minute, value.second) + ++ + def TimeConverterMS(value, db): - return "'%02d:%02d:%02d.%06d'" % (value.hour, value.minute, value.second, value.microsecond) + return "'%02d:%02d:%02d.%06d'" % (value.hour, value.minute, + value.second, value.microsecond) - registerConverter(datetime.time, TimeConverter) + registerConverter(datetime.time, TimeConverterMS) + def DecimalConverter(value, db): return value.to_eng_string() http://sourceforge.net/p/sqlobject/sqlobject/ci/e59e089b78b5ed3e70a9d4695f2a3265f7ccd1bc commit e59e089b78b5ed3e70a9d4695f2a3265f7ccd1bc Merge: b75adf0 40077a5 Author: Oleg Broytman <ph...@ph...> Date: Wed Jun 17 21:51:09 2015 +0300 Null-merge branch 2.2 http://sourceforge.net/p/sqlobject/sqlobject/ci/b75adf042b0a3961b4022ab43a00c5da91d131b4 commit b75adf042b0a3961b4022ab43a00c5da91d131b4 Merge: e3ec249 b3381c4 Author: Oleg Broytman <ph...@ph...> Date: Wed Jun 17 21:50:29 2015 +0300 Merge branch '2.1' ----------------------------------------------------------------------- Summary of changes: docs/News.txt | 24 +++++++++++++++++++++++- sqlobject/col.py | 31 ++++++++++++++++++++++++++++++- sqlobject/converters.py | 24 +++++++++++++++++------- sqlobject/mssql/mssqlconnection.py | 15 +++++++++++++++ sqlobject/tests/test_datetime.py | 21 +++++++++++++++++++-- 5 files changed, 104 insertions(+), 11 deletions(-) hooks/post-receive -- SQLObject development repository |