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 42354eecb64659544f8efa80b04da466eac76989 (commit)
via c479b9ba6f114c37364981b0c0ce1bb9cc826516 (commit)
via c029aa68148b403cf070eb868235af714b236708 (commit)
via e527ceb9b765e2fa5cc24c7d2e1a260390786f69 (commit)
via 9404c1087898390d1cec4d916cb6ce564984ef39 (commit)
from a02ae6f0c4823d55b556e0d692ea48b3ceb537f8 (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/42354eecb64659544f8efa80b04da466eac76989
commit 42354eecb64659544f8efa80b04da466eac76989
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 14:32:38 2017 +0300
Add firebirdsql to the list of default drivers for Firebird
diff --git a/docs/News.rst b/docs/News.rst
index a043ed6..436fe15 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -20,9 +20,9 @@ Minor features
* Remove ``driver`` keyword from RdbhostConnection as it allows one driver
``rdbhdb``.
-* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb'
- or 'kinterbasdb'. Default is to test 'fdb' and 'kinterbasdb' in that
- order. pyfirebirdsql is supported but untested.
+* Add ``driver`` keyword for FirebirdConnection. Allowed values are 'fdb',
+ 'kinterbasdb' or 'firebirdsql'. Default is to test 'fdb', 'kinterbasdb' and
+ 'firebirdsql' in that order.
* Add ``driver`` keyword for MySQLConnection. Allowed value are 'mysqldb',
'connector', 'oursql' and 'pymysql'. Default is to test for mysqldb only.
@@ -77,7 +77,7 @@ Tests
* Drop ``Circle CI``.
* Run at Travis CI tests with Firebird backend (server version 2.5; drivers fdb
- and firebirdsql). There are problems with tests.
+ and firebirdsql). There are some problems with tests.
* Add AppVeyor for windows testing. Run tests with Postgres and MS SQL. There
are problems with MS SQL.
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index 3bf3fb5..41e1a31 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -16,7 +16,7 @@ class FirebirdConnection(DBAPI):
def __init__(self, host, db, port='3050', user='sysdba',
password='masterkey', autoCommit=1,
dialect=None, role=None, charset=None, **kw):
- drivers = kw.pop('driver', None) or 'fdb,kinterbasdb'
+ drivers = kw.pop('driver', None) or 'fdb,kinterbasdb,firebirdsql'
for driver in drivers.split(','):
driver = driver.strip()
if not driver:
http://sourceforge.net/p/sqlobject/sqlobject/ci/c479b9ba6f114c37364981b0c0ce1bb9cc826516
commit c479b9ba6f114c37364981b0c0ce1bb9cc826516
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 13:48:53 2017 +0300
Fix test: convert mx.DateTime to date
diff --git a/sqlobject/tests/test_datetime.py b/sqlobject/tests/test_datetime.py
index 7aade08..58c43f9 100644
--- a/sqlobject/tests/test_datetime.py
+++ b/sqlobject/tests/test_datetime.py
@@ -105,7 +105,7 @@ if mxdatetime_available:
def test_mxDateTime():
setupClass(DateTime2)
_now = now()
- dt2 = DateTime2(col1=_now, col2=_now,
+ dt2 = DateTime2(col1=_now, col2=_now.pydate(),
col3=Time(_now.hour, _now.minute, _now.second))
assert isinstance(dt2.col1, col.DateTimeType)
@@ -120,14 +120,9 @@ if mxdatetime_available:
assert dt2.col2.year == _now.year
assert dt2.col2.month == _now.month
assert dt2.col2.day == _now.day
- if getConnection().dbName == "sqlite":
- assert dt2.col2.hour == _now.hour
- assert dt2.col2.minute == _now.minute
- assert dt2.col2.second == int(_now.second)
- else:
- assert dt2.col2.hour == 0
- assert dt2.col2.minute == 0
- assert dt2.col2.second == 0
+ assert dt2.col2.hour == 0
+ assert dt2.col2.minute == 0
+ assert dt2.col2.second == 0
assert isinstance(dt2.col3, (col.DateTimeType, col.TimeType))
assert dt2.col3.hour == _now.hour
http://sourceforge.net/p/sqlobject/sqlobject/ci/c029aa68148b403cf070eb868235af714b236708
commit c029aa68148b403cf070eb868235af714b236708
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 13:11:35 2017 +0300
Fix TEXT type in id/foreign keys: Firebird doesn't have TEXT type
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 2385e09..c919e59 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -902,6 +902,10 @@ class SOKeyCol(SOCol):
key_type = {int: "INT NULL", str: "TEXT"}
return key_type[self._idType()]
+ def _firebirdType(self):
+ key_type = {int: "INT", str: "VARCHAR(255)"}
+ return key_type[self._idType()]
+
class KeyCol(Col):
diff --git a/sqlobject/firebird/firebirdconnection.py b/sqlobject/firebird/firebirdconnection.py
index ba60123..3bf3fb5 100644
--- a/sqlobject/firebird/firebirdconnection.py
+++ b/sqlobject/firebird/firebirdconnection.py
@@ -169,7 +169,7 @@ class FirebirdConnection(DBAPI):
return col.firebirdCreateSQL()
def createIDColumn(self, soClass):
- key_type = {int: "INT", str: "TEXT"}[soClass.sqlmeta.idType]
+ key_type = {int: "INT", str: "VARCHAR(255)"}[soClass.sqlmeta.idType]
return '%s %s NOT NULL PRIMARY KEY' % (soClass.sqlmeta.idName,
key_type)
http://sourceforge.net/p/sqlobject/sqlobject/ci/e527ceb9b765e2fa5cc24c7d2e1a260390786f69
commit e527ceb9b765e2fa5cc24c7d2e1a260390786f69
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 14 12:05:57 2017 +0300
Fix tests for Firebird: shorten table names
Firebird doesn't allow table/column names to be longer than 31 characters.
diff --git a/sqlobject/inheritance/tests/test_foreignKey.py b/sqlobject/inheritance/tests/test_foreignKey.py
index c1f70e1..3e63c26 100644
--- a/sqlobject/inheritance/tests/test_foreignKey.py
+++ b/sqlobject/inheritance/tests/test_foreignKey.py
@@ -79,16 +79,16 @@ def test_foreignKey():
assert employee.count() == 2
-class SOTestInheritableBase(InheritableSQLObject):
+class SOTestInhBase(InheritableSQLObject):
pass
-class SOTestInheritableForeignKey(SOTestInheritableBase):
- base = ForeignKey("SOTestInheritableBase")
+class SOTestInhFKey(SOTestInhBase):
+ base = ForeignKey("SOTestInhBase")
def test_foreignKey2():
- setupClass([SOTestInheritableBase, SOTestInheritableForeignKey])
+ setupClass([SOTestInhBase, SOTestInhFKey])
- test = SOTestInheritableBase()
- SOTestInheritableForeignKey(base=test)
+ test = SOTestInhBase()
+ SOTestInhFKey(base=test)
diff --git a/sqlobject/inheritance/tests/test_indexes.py b/sqlobject/inheritance/tests/test_indexes.py
index f2ed38a..085725c 100644
--- a/sqlobject/inheritance/tests/test_indexes.py
+++ b/sqlobject/inheritance/tests/test_indexes.py
@@ -3,41 +3,40 @@ from sqlobject.tests.dbtest import setupClass
from sqlobject.inheritance import InheritableSQLObject
-class InheritedPersonIndexGet(InheritableSQLObject):
+class InhPersonIdxGet(InheritableSQLObject):
first_name = StringCol(notNone=True, length=100)
last_name = StringCol(notNone=True, length=100)
age = IntCol()
pk = DatabaseIndex(first_name, last_name, unique=True)
-class InheritedEmployeeIndexGet(InheritedPersonIndexGet):
+class InhEmployeeIdxGet(InhPersonIdxGet):
security_number = IntCol()
experience = IntCol()
sec_index = DatabaseIndex(security_number, unique=True)
-class InheritedSalesManIndexGet(InheritedEmployeeIndexGet):
+class InhSalesManIdxGet(InhEmployeeIdxGet):
_inheritable = False
skill = IntCol()
def test_index_get_1():
- setupClass([InheritedPersonIndexGet, InheritedEmployeeIndexGet,
- InheritedSalesManIndexGet])
+ setupClass([InhPersonIdxGet, InhEmployeeIdxGet, InhSalesManIdxGet])
- InheritedSalesManIndexGet(first_name='Michael', last_name='Pallin', age=65,
+ InhSalesManIdxGet(first_name='Michael', last_name='Pallin', age=65,
security_number=2304, experience=2, skill=10)
- InheritedEmployeeIndexGet(first_name='Eric', last_name='Idle', age=63,
+ InhEmployeeIdxGet(first_name='Eric', last_name='Idle', age=63,
security_number=3402, experience=9)
- InheritedPersonIndexGet(first_name='Terry', last_name='Guilliam', age=64)
-
- InheritedPersonIndexGet.pk.get('Michael', 'Pallin')
- InheritedEmployeeIndexGet.pk.get('Michael', 'Pallin')
- InheritedSalesManIndexGet.pk.get('Michael', 'Pallin')
- InheritedPersonIndexGet.pk.get('Eric', 'Idle')
- InheritedEmployeeIndexGet.pk.get('Eric', 'Idle')
- InheritedPersonIndexGet.pk.get(first_name='Terry', last_name='Guilliam')
- InheritedEmployeeIndexGet.sec_index.get(2304)
- InheritedEmployeeIndexGet.sec_index.get(3402)
- InheritedSalesManIndexGet.sec_index.get(2304)
- InheritedSalesManIndexGet.sec_index.get(3402)
+ InhPersonIdxGet(first_name='Terry', last_name='Guilliam', age=64)
+
+ InhPersonIdxGet.pk.get('Michael', 'Pallin')
+ InhEmployeeIdxGet.pk.get('Michael', 'Pallin')
+ InhSalesManIdxGet.pk.get('Michael', 'Pallin')
+ InhPersonIdxGet.pk.get('Eric', 'Idle')
+ InhEmployeeIdxGet.pk.get('Eric', 'Idle')
+ InhPersonIdxGet.pk.get(first_name='Terry', last_name='Guilliam')
+ InhEmployeeIdxGet.sec_index.get(2304)
+ InhEmployeeIdxGet.sec_index.get(3402)
+ InhSalesManIdxGet.sec_index.get(2304)
+ InhSalesManIdxGet.sec_index.get(3402)
diff --git a/sqlobject/tests/test_cyclic_reference.py b/sqlobject/tests/test_cyclic_reference.py
index 7350216..be22989 100644
--- a/sqlobject/tests/test_cyclic_reference.py
+++ b/sqlobject/tests/test_cyclic_reference.py
@@ -4,52 +4,52 @@ from sqlobject import BLOBCol, DateTimeCol, ForeignKey, IntCol, SQLObject, \
from sqlobject.tests.dbtest import getConnection, supports
-class SOTestCyclicReferenceA(SQLObject):
+class SOTestCyclicRefA(SQLObject):
class sqlmeta(sqlmeta):
idName = 'test_id_here'
- table = 'test_cyclic_reference_a_table'
+ table = 'test_cyclic_ref_a_table'
name = StringCol()
number = IntCol()
so_time = DateTimeCol()
short = StringCol(length=10)
blobcol = BLOBCol()
- fkeyb = ForeignKey('SOTestCyclicReferenceB')
+ fkeyb = ForeignKey('SOTestCyclicRefB')
-class SOTestCyclicReferenceB(SQLObject):
+class SOTestCyclicRefB(SQLObject):
class sqlmeta(sqlmeta):
idName = 'test_id_here'
- table = 'test_cyclic_reference_b_table'
+ table = 'test_cyclic_ref_b_table'
name = StringCol()
number = IntCol()
so_time = DateTimeCol()
short = StringCol(length=10)
blobcol = BLOBCol()
- fkeya = ForeignKey('SOTestCyclicReferenceA')
+ fkeya = ForeignKey('SOTestCyclicRefA')
def test_cyclic_reference():
if not supports('dropTableCascade'):
pytest.skip("dropTableCascade isn't supported")
conn = getConnection()
- SOTestCyclicReferenceA.setConnection(conn)
- SOTestCyclicReferenceB.setConnection(conn)
- SOTestCyclicReferenceA.dropTable(ifExists=True, cascade=True)
- assert not conn.tableExists(SOTestCyclicReferenceA.sqlmeta.table)
- SOTestCyclicReferenceB.dropTable(ifExists=True, cascade=True)
- assert not conn.tableExists(SOTestCyclicReferenceB.sqlmeta.table)
-
- constraints = SOTestCyclicReferenceA.createTable(ifNotExists=True,
+ SOTestCyclicRefA.setConnection(conn)
+ SOTestCyclicRefB.setConnection(conn)
+ SOTestCyclicRefA.dropTable(ifExists=True, cascade=True)
+ assert not conn.tableExists(SOTestCyclicRefA.sqlmeta.table)
+ SOTestCyclicRefB.dropTable(ifExists=True, cascade=True)
+ assert not conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
+
+ constraints = SOTestCyclicRefA.createTable(ifNotExists=True,
applyConstraints=False)
- assert conn.tableExists(SOTestCyclicReferenceA.sqlmeta.table)
- constraints += SOTestCyclicReferenceB.createTable(ifNotExists=True,
+ assert conn.tableExists(SOTestCyclicRefA.sqlmeta.table)
+ constraints += SOTestCyclicRefB.createTable(ifNotExists=True,
applyConstraints=False)
- assert conn.tableExists(SOTestCyclicReferenceB.sqlmeta.table)
+ assert conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
for constraint in constraints:
conn.query(constraint)
- SOTestCyclicReferenceA.dropTable(ifExists=True, cascade=True)
- assert not conn.tableExists(SOTestCyclicReferenceA.sqlmeta.table)
- SOTestCyclicReferenceB.dropTable(ifExists=True, cascade=True)
- assert not conn.tableExists(SOTestCyclicReferenceB.sqlmeta.table)
+ SOTestCyclicRefA.dropTable(ifExists=True, cascade=True)
+ assert not conn.tableExists(SOTestCyclicRefA.sqlmeta.table)
+ SOTestCyclicRefB.dropTable(ifExists=True, cascade=True)
+ assert not conn.tableExists(SOTestCyclicRefB.sqlmeta.table)
diff --git a/sqlobject/tests/test_new_joins.py b/sqlobject/tests/test_new_joins.py
index a70e1dc..3a97e98 100644
--- a/sqlobject/tests/test_new_joins.py
+++ b/sqlobject/tests/test_new_joins.py
@@ -9,16 +9,16 @@ from sqlobject.tests.dbtest import setupClass
########################################
-class PersonJoinerNew(SQLObject):
+class PersonJNew(SQLObject):
name = StringCol(length=40, alternateID=True)
- addressJoiners = ManyToMany('AddressJoinerNew')
+ addressJs = ManyToMany('AddressJNew')
-class AddressJoinerNew(SQLObject):
+class AddressJNew(SQLObject):
zip = StringCol(length=5, alternateID=True)
- personJoiners = ManyToMany('PersonJoinerNew')
+ personJs = ManyToMany('PersonJNew')
class ImplicitJoiningSONew(SQLObject):
@@ -32,29 +32,29 @@ class ExplicitJoiningSONew(SQLObject):
class TestJoin:
def setup_method(self, meth):
- setupClass(PersonJoinerNew)
- setupClass(AddressJoinerNew)
+ setupClass(PersonJNew)
+ setupClass(AddressJNew)
for n in ['bob', 'tim', 'jane', 'joe', 'fred', 'barb']:
- PersonJoinerNew(name=n)
+ PersonJNew(name=n)
for z in ['11111', '22222', '33333', '44444']:
- AddressJoinerNew(zip=z)
+ AddressJNew(zip=z)
def test_join(self):
- b = PersonJoinerNew.byName('bob')
- assert list(b.addressJoiners) == []
- z = AddressJoinerNew.byZip('11111')
- b.addressJoiners.add(z)
- self.assertZipsEqual(b.addressJoiners, ['11111'])
- print(str(z.personJoiners), repr(z.personJoiners))
- self.assertNamesEqual(z.personJoiners, ['bob'])
- z2 = AddressJoinerNew.byZip('22222')
- b.addressJoiners.add(z2)
- print(str(b.addressJoiners))
- self.assertZipsEqual(b.addressJoiners, ['11111', '22222'])
- self.assertNamesEqual(z2.personJoiners, ['bob'])
- b.addressJoiners.remove(z)
- self.assertZipsEqual(b.addressJoiners, ['22222'])
- self.assertNamesEqual(z.personJoiners, [])
+ b = PersonJNew.byName('bob')
+ assert list(b.addressJs) == []
+ z = AddressJNew.byZip('11111')
+ b.addressJs.add(z)
+ self.assertZipsEqual(b.addressJs, ['11111'])
+ print(str(z.personJs), repr(z.personJs))
+ self.assertNamesEqual(z.personJs, ['bob'])
+ z2 = AddressJNew.byZip('22222')
+ b.addressJs.add(z2)
+ print(str(b.addressJs))
+ self.assertZipsEqual(b.addressJs, ['11111', '22222'])
+ self.assertNamesEqual(z2.personJs, ['bob'])
+ b.addressJs.remove(z)
+ self.assertZipsEqual(b.addressJs, ['22222'])
+ self.assertNamesEqual(z.personJs, [])
def assertZipsEqual(self, zips, dest):
assert [a.zip for a in zips] == dest
@@ -72,94 +72,94 @@ class TestJoin:
assert not hasattr(ExplicitJoiningSONew, 'bars')
-class PersonJoinerNew2(SQLObject):
+class PersonJNew2(SQLObject):
name = StringCol('name', length=40, alternateID=True)
- addressJoiner2s = OneToMany('AddressJoinerNew2')
+ addressJ2s = OneToMany('AddressJNew2')
-class AddressJoinerNew2(SQLObject):
+class AddressJNew2(SQLObject):
class sqlmeta:
defaultOrder = ['-zip', 'plus4']
zip = StringCol(length=5)
plus4 = StringCol(length=4, default=None)
- personJoinerNew2 = ForeignKey('PersonJoinerNew2')
+ personJNew2 = ForeignKey('PersonJNew2')
class TestJoin2:
def setup_method(self, meth):
- setupClass([PersonJoinerNew2, AddressJoinerNew2])
- p1 = PersonJoinerNew2(name='bob')
- p2 = PersonJoinerNew2(name='sally')
+ setupClass([PersonJNew2, AddressJNew2])
+ p1 = PersonJNew2(name='bob')
+ p2 = PersonJNew2(name='sally')
for z in ['11111', '22222', '33333']:
- AddressJoinerNew2(zip=z, personJoinerNew2=p1)
- AddressJoinerNew2(zip='00000', personJoinerNew2=p2)
+ AddressJNew2(zip=z, personJNew2=p1)
+ AddressJNew2(zip='00000', personJNew2=p2)
def test_basic(self):
- bob = PersonJoinerNew2.byName('bob')
- sally = PersonJoinerNew2.byName('sally')
- print(bob.addressJoiner2s)
+ bob = PersonJNew2.byName('bob')
+ sally = PersonJNew2.byName('sally')
+ print(bob.addressJ2s)
print(bob)
- assert len(list(bob.addressJoiner2s)) == 3
- assert len(list(sally.addressJoiner2s)) == 1
- bob.addressJoiner2s[0].destroySelf()
- assert len(list(bob.addressJoiner2s)) == 2
- z = bob.addressJoiner2s[0]
+ assert len(list(bob.addressJ2s)) == 3
+ assert len(list(sally.addressJ2s)) == 1
+ bob.addressJ2s[0].destroySelf()
+ assert len(list(bob.addressJ2s)) == 2
+ z = bob.addressJ2s[0]
z.zip = 'xxxxx'
id = z.id
del z
- z = AddressJoinerNew2.get(id)
+ z = AddressJNew2.get(id)
assert z.zip == 'xxxxx'
def test_defaultOrder(self):
- p1 = PersonJoinerNew2.byName('bob')
- assert ([i.zip for i in p1.addressJoiner2s] ==
+ p1 = PersonJNew2.byName('bob')
+ assert ([i.zip for i in p1.addressJ2s] ==
['33333', '22222', '11111'])
-_personJoiner3_getters = []
-_personJoiner3_setters = []
+_personJ3_getters = []
+_personJ3_setters = []
-class PersonJoinerNew3(SQLObject):
+class PersonJNew3(SQLObject):
name = StringCol('name', length=40, alternateID=True)
- addressJoinerNew3s = OneToMany('AddressJoinerNew3')
+ addressJNew3s = OneToMany('AddressJNew3')
-class AddressJoinerNew3(SQLObject):
+class AddressJNew3(SQLObject):
zip = StringCol(length=5)
- personJoinerNew3 = ForeignKey('PersonJoinerNew3')
+ personJNew3 = ForeignKey('PersonJNew3')
- def _get_personJoinerNew3(self):
- value = self._SO_get_personJoinerNew3()
- _personJoiner3_getters.append((self, value))
+ def _get_personJNew3(self):
+ value = self._SO_get_personJNew3()
+ _personJ3_getters.append((self, value))
return value
- def _set_personJoinerNew3(self, value):
- self._SO_set_personJoinerNew3(value)
- _personJoiner3_setters.append((self, value))
+ def _set_personJNew3(self, value):
+ self._SO_set_personJNew3(value)
+ _personJ3_setters.append((self, value))
class TestJoin3:
... 156 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|