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 217bbb8a7ece95f956dc3718c7d8bb0ddbb34155 (commit)
via 0371cdd380c92782910cf597481ac648b043d4d8 (commit)
via d80b1755f78ccf8c3ee81e4edf0191ca3098a407 (commit)
via 215015c375813066bccec69afc4f84025ecc895d (commit)
via 011de15af92da33b229aa7ead8d36a702f6ac4b4 (commit)
via b957864e7f92bbd09811f4e15a146baded63bae9 (commit)
via ce16fb72a08ba5c041432f98742937ede99077ff (commit)
via 0f2ecd4c3afeeaf9e0d343daa8b37da5efc52e23 (commit)
via e222f62c0c193654ed49f00b2ac1ad98d9daae7b (commit)
from c5c2b34590f51dcdfa8b8754a00fa624ff9b97b5 (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/217bbb8a7ece95f956dc3718c7d8bb0ddbb34155
commit 217bbb8a7ece95f956dc3718c7d8bb0ddbb34155
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jul 10 17:05:42 2016 +0300
Document UuidCol
[skip ci]
diff --git a/docs/SQLObject.txt b/docs/SQLObject.txt
index 4b04f44..7257514 100644
--- a/docs/SQLObject.txt
+++ b/docs/SQLObject.txt
@@ -1269,6 +1269,9 @@ different types of columns, when SQLObject creates your tables.
MyTable.select((MyTable.q.name + MyTable.q.surname) == u'value'.encode(dbEncoding))
+`UuidCol`:
+ A column for UUID. On Postgres uses 'UUID' data type, on all other
+backends uses VARCHAR(36).
Relationships Between Classes/Tables
http://sourceforge.net/p/sqlobject/sqlobject/ci/0371cdd380c92782910cf597481ac648b043d4d8
commit 0371cdd380c92782910cf597481ac648b043d4d8
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jul 10 16:58:51 2016 +0300
Small enhancements in UuidCol
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 2729f26..9101b2c 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -22,7 +22,7 @@ from array import array
from decimal import Decimal
from itertools import count
import time
-import uuid
+from uuid import UUID
try:
import cPickle as pickle
except ImportError:
@@ -692,7 +692,7 @@ class UuidValidator(SOValidator):
if value is None:
return None
if isinstance(value, str):
- return uuid.UUID(value)
+ return UUID(value)
raise validators.Invalid(
"expected string in the UuidCol '%s', "
"got %s %r instead" % (
@@ -701,7 +701,7 @@ class UuidValidator(SOValidator):
def from_python(self, value, state):
if value is None:
return None
- if isinstance(value, (uuid.UUID)):
+ if isinstance(value, UUID):
return str(value)
raise validators.Invalid(
"expected uuid in the UuidCol '%s', "
@@ -710,9 +710,6 @@ class UuidValidator(SOValidator):
class SOUuidCol(SOCol):
- # def autoConstraints(self):
- # return [constrs.isUuid]
-
def createValidators(self):
return [UuidValidator(name=self.name)] + \
super(SOUuidCol, self).createValidators()
http://sourceforge.net/p/sqlobject/sqlobject/ci/d80b1755f78ccf8c3ee81e4edf0191ca3098a407
commit d80b1755f78ccf8c3ee81e4edf0191ca3098a407
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jul 10 16:54:39 2016 +0300
Fix flake8 warnings
diff --git a/sqlobject/tests/test_uuidcol.py b/sqlobject/tests/test_uuidcol.py
index 81000ef..23ce2a2 100644
--- a/sqlobject/tests/test_uuidcol.py
+++ b/sqlobject/tests/test_uuidcol.py
@@ -1,5 +1,4 @@
-import uuid
-import py.test
+from uuid import UUID
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -9,7 +8,8 @@ from sqlobject.tests.dbtest import *
########################################
-testuuid = uuid.UUID('7e3b5c1e-3402-4b10-a3c6-8ee6dbac7d1a')
+testuuid = UUID('7e3b5c1e-3402-4b10-a3c6-8ee6dbac7d1a')
+
class UuidContainer(SQLObject):
uuiddata = UuidCol(default=None)
@@ -26,4 +26,3 @@ def test_uuidCol():
my_uuid_2 = UuidContainer.get(iid)
assert my_uuid_2.uuiddata == testuuid
-
http://sourceforge.net/p/sqlobject/sqlobject/ci/215015c375813066bccec69afc4f84025ecc895d
commit 215015c375813066bccec69afc4f84025ecc895d
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jul 10 16:52:26 2016 +0300
The next release will be 3.1.0
diff --git a/README.txt b/README.txt
index 2fb247d..d4b129a 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,4 @@
-SQLObject 3.0.0
+SQLObject 3.1.0
===============
Thanks for looking at SQLObject. SQLObject is an object-relational
diff --git a/docs/News.txt b/docs/News.txt
index 4af8a53..26083f7 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -7,7 +7,7 @@ News
.. _start:
-SQLObject 3.0.0 (master)
+SQLObject 3.1.0 (master)
========================
Features
@@ -21,6 +21,9 @@ Documentation
* Developer's Guide extended to explain SQLObject architecture and how
to create a new column type.
+SQLObject 3.0.0
+===============
+
Released 1 Jun 2016.
Features
diff --git a/setup.cfg b/setup.cfg
index b6e6ba4..5aef598 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -3,8 +3,8 @@ command_packages = buildutils.pudge_command,
buildutils.publish_command
[egg_info]
-tag_build =
-tag_date = 0
+tag_build = dev
+tag_date = 1
tag_svn_revision = 0
[flake8]
diff --git a/sqlobject/__version__.py b/sqlobject/__version__.py
index 431113f..f1ebb14 100644
--- a/sqlobject/__version__.py
+++ b/sqlobject/__version__.py
@@ -1,8 +1,8 @@
-version = '3.0.0'
+version = '3.1.0'
major = 3
-minor = 0
+minor = 1
micro = 0
-release_level = 'final'
+release_level = 'trunk'
serial = 0
version_info = (major, minor, micro, release_level, serial)
http://sourceforge.net/p/sqlobject/sqlobject/ci/011de15af92da33b229aa7ead8d36a702f6ac4b4
commit 011de15af92da33b229aa7ead8d36a702f6ac4b4
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jul 10 16:51:52 2016 +0300
Developer's Guide was extended
[skip ci]
diff --git a/docs/News.txt b/docs/News.txt
index ca4692b..4af8a53 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -15,6 +15,12 @@ Features
* Add UuidCol.
+Documentation
+-------------
+
+* Developer's Guide extended to explain SQLObject architecture and how
+ to create a new column type.
+
Released 1 Jun 2016.
Features
http://sourceforge.net/p/sqlobject/sqlobject/ci/b957864e7f92bbd09811f4e15a146baded63bae9
commit b957864e7f92bbd09811f4e15a146baded63bae9
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jul 10 16:50:49 2016 +0300
Lutz Steinborn added UuidCol
[skip ci]
diff --git a/docs/Authors.txt b/docs/Authors.txt
index 5dbc625..cf35dfc 100644
--- a/docs/Authors.txt
+++ b/docs/Authors.txt
@@ -33,6 +33,7 @@ Contributions have been made by:
* Lukasz Dobrzanski <lukasz.m.dobrzanski at gmail.com>
* Gregor Horvath <gh at gregor-horvath.com>
* Nathan Edwards <nje5 at georgetown.edu>
+* Lutz Steinborn <l.steinborn at 4c-gmbh.de>
* Oleg Broytman <ph...@ph...>
.. image:: https://sourceforge.net/sflogo.php?group_id=74338&type=10
diff --git a/docs/News.txt b/docs/News.txt
index 3cfec6e..ca4692b 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -10,6 +10,11 @@ News
SQLObject 3.0.0 (master)
========================
+Features
+--------
+
+* Add UuidCol.
+
Released 1 Jun 2016.
Features
http://sourceforge.net/p/sqlobject/sqlobject/ci/ce16fb72a08ba5c041432f98742937ede99077ff
commit ce16fb72a08ba5c041432f98742937ede99077ff
Merge: c5c2b34 0f2ecd4
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jul 10 17:39:07 2016 +0400
Merge pull request #118 from LutzSteinborn/master
UuidCol
http://sourceforge.net/p/sqlobject/sqlobject/ci/0f2ecd4c3afeeaf9e0d343daa8b37da5efc52e23
commit 0f2ecd4c3afeeaf9e0d343daa8b37da5efc52e23
Author: Lutz Steinborn <l.s...@4c...>
Date: Sun Jul 10 08:05:30 2016 +0200
added VARCHAR(36) for DBs with out uuid type
diff --git a/sqlobject/col.py b/sqlobject/col.py
index b1287cd..2729f26 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -710,13 +710,16 @@ class UuidValidator(SOValidator):
class SOUuidCol(SOCol):
- #def autoConstraints(self):
+ # def autoConstraints(self):
# return [constrs.isUuid]
def createValidators(self):
return [UuidValidator(name=self.name)] + \
super(SOUuidCol, self).createValidators()
+ def _sqlType(self):
+ return 'VARCHAR(36)'
+
def _postgresType(self):
return 'UUID'
http://sourceforge.net/p/sqlobject/sqlobject/ci/e222f62c0c193654ed49f00b2ac1ad98d9daae7b
commit e222f62c0c193654ed49f00b2ac1ad98d9daae7b
Author: Lutz Steinborn <l.s...@4c...>
Date: Sat Jul 9 17:09:04 2016 +0200
UuidCol and test added
diff --git a/sqlobject/col.py b/sqlobject/col.py
index bc57813..b1287cd 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -22,6 +22,7 @@ from array import array
from decimal import Decimal
from itertools import count
import time
+import uuid
try:
import cPickle as pickle
except ImportError:
@@ -685,6 +686,45 @@ class UnicodeCol(Col):
baseClass = SOUnicodeCol
+class UuidValidator(SOValidator):
+
+ def to_python(self, value, state):
+ if value is None:
+ return None
+ if isinstance(value, str):
+ return uuid.UUID(value)
+ raise validators.Invalid(
+ "expected string in the UuidCol '%s', "
+ "got %s %r instead" % (
+ self.name, type(value), value), value, state)
+
+ def from_python(self, value, state):
+ if value is None:
+ return None
+ if isinstance(value, (uuid.UUID)):
+ return str(value)
+ raise validators.Invalid(
+ "expected uuid in the UuidCol '%s', "
+ "got %s %r instead" % (
+ self.name, type(value), value), value, state)
+
+
+class SOUuidCol(SOCol):
+ #def autoConstraints(self):
+ # return [constrs.isUuid]
+
+ def createValidators(self):
+ return [UuidValidator(name=self.name)] + \
+ super(SOUuidCol, self).createValidators()
+
+ def _postgresType(self):
+ return 'UUID'
+
+
+class UuidCol(Col):
+ baseClass = SOUuidCol
+
+
class IntValidator(SOValidator):
def to_python(self, value, state):
diff --git a/sqlobject/tests/test_uuidcol.py b/sqlobject/tests/test_uuidcol.py
new file mode 100644
index 0000000..81000ef
--- /dev/null
+++ b/sqlobject/tests/test_uuidcol.py
@@ -0,0 +1,29 @@
+import uuid
+import py.test
+from sqlobject import *
+from sqlobject.tests.dbtest import *
+
+
+########################################
+# Uuid columns
+########################################
+
+
+testuuid = uuid.UUID('7e3b5c1e-3402-4b10-a3c6-8ee6dbac7d1a')
+
+class UuidContainer(SQLObject):
+ uuiddata = UuidCol(default=None)
+
+
+def test_uuidCol():
+ setupClass([UuidContainer], force=True)
+
+ my_uuid = UuidContainer(uuiddata=testuuid)
+ iid = my_uuid.id
+
+ UuidContainer._connection.cache.clear()
+
+ my_uuid_2 = UuidContainer.get(iid)
+
+ assert my_uuid_2.uuiddata == testuuid
+
-----------------------------------------------------------------------
Summary of changes:
README.txt | 2 +-
docs/Authors.txt | 1 +
docs/News.txt | 16 ++++++++++++++-
docs/SQLObject.txt | 3 ++
setup.cfg | 4 +-
sqlobject/__version__.py | 6 ++--
sqlobject/col.py | 40 +++++++++++++++++++++++++++++++++++++++
sqlobject/tests/test_uuidcol.py | 28 +++++++++++++++++++++++++++
8 files changed, 93 insertions(+), 7 deletions(-)
create mode 100644 sqlobject/tests/test_uuidcol.py
hooks/post-receive
--
SQLObject development repository
|