Hello community,

here is the log from the commit of package python-SQLAlchemy-Utils for 
openSUSE:Factory checked in at 2017-10-09 19:46:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils (Old)
 and      /work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-SQLAlchemy-Utils"

Mon Oct  9 19:46:59 2017 rev:5 rq:532614 version:0.32.18

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils/python-SQLAlchemy-Utils.changes
  2017-09-27 16:55:27.834132136 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new/python-SQLAlchemy-Utils.changes
     2017-10-09 19:48:42.878282572 +0200
@@ -1,0 +2,14 @@
+Sat Oct  7 14:41:15 UTC 2017 - a...@gmx.de
+
+- update to version 0.32.18:
+  * Made aggregated attributes to work with subclass objects (#287,
+    pull request courtesy of fayazkhan)
+
+-------------------------------------------------------------------
+Sat Sep 30 16:30:16 UTC 2017 - a...@gmx.de
+
+- update to version 0.32.17:
+  * Added support for MSSQL uniqueidentifier type (#283, pull request
+    courtesy of nHurD)
+
+-------------------------------------------------------------------

Old:
----
  SQLAlchemy-Utils-0.32.16.tar.gz

New:
----
  SQLAlchemy-Utils-0.32.18.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-SQLAlchemy-Utils.spec ++++++
--- /var/tmp/diff_new_pack.3UQFDn/_old  2017-10-09 19:48:43.390260070 +0200
+++ /var/tmp/diff_new_pack.3UQFDn/_new  2017-10-09 19:48:43.394259895 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-SQLAlchemy-Utils
-Version:        0.32.16
+Version:        0.32.18
 Release:        0
 Summary:        Various utility functions for SQLAlchemy
 License:        BSD-3-Clause

++++++ SQLAlchemy-Utils-0.32.16.tar.gz -> SQLAlchemy-Utils-0.32.18.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.32.16/CHANGES.rst 
new/SQLAlchemy-Utils-0.32.18/CHANGES.rst
--- old/SQLAlchemy-Utils-0.32.16/CHANGES.rst    2017-09-01 11:08:03.000000000 
+0200
+++ new/SQLAlchemy-Utils-0.32.18/CHANGES.rst    2017-10-06 09:17:30.000000000 
+0200
@@ -4,6 +4,18 @@
 Here you can see the full list of changes between each SQLAlchemy-Utils 
release.
 
 
+0.32.18 (2017-10-06)
+^^^^^^^^^^^^^^^^^^^^
+
+- Made aggregated attributes to work with subclass objects (#287, pull request 
courtesy of fayazkhan)
+
+
+0.32.17 (2017-09-29)
+^^^^^^^^^^^^^^^^^^^^
+
+- Added support for MSSQL uniqueidentifier type (#283, pull request courtesy 
of nHurD)
+
+
 0.32.16 (2017-09-01)
 ^^^^^^^^^^^^^^^^^^^^
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.32.16/PKG-INFO 
new/SQLAlchemy-Utils-0.32.18/PKG-INFO
--- old/SQLAlchemy-Utils-0.32.16/PKG-INFO       2017-09-01 11:09:22.000000000 
+0200
+++ new/SQLAlchemy-Utils-0.32.18/PKG-INFO       2017-10-06 09:18:25.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: SQLAlchemy-Utils
-Version: 0.32.16
+Version: 0.32.18
 Summary: Various utility functions for SQLAlchemy.
 Home-page: https://github.com/kvesteri/sqlalchemy-utils
 Author: Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.16/SQLAlchemy_Utils.egg-info/PKG-INFO 
new/SQLAlchemy-Utils-0.32.18/SQLAlchemy_Utils.egg-info/PKG-INFO
--- old/SQLAlchemy-Utils-0.32.16/SQLAlchemy_Utils.egg-info/PKG-INFO     
2017-09-01 11:09:21.000000000 +0200
+++ new/SQLAlchemy-Utils-0.32.18/SQLAlchemy_Utils.egg-info/PKG-INFO     
2017-10-06 09:18:25.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: SQLAlchemy-Utils
-Version: 0.32.16
+Version: 0.32.18
 Summary: Various utility functions for SQLAlchemy.
 Home-page: https://github.com/kvesteri/sqlalchemy-utils
 Author: Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.16/sqlalchemy_utils/__init__.py 
new/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/__init__.py
--- old/SQLAlchemy-Utils-0.32.16/sqlalchemy_utils/__init__.py   2017-09-01 
11:08:46.000000000 +0200
+++ new/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/__init__.py   2017-10-06 
09:16:21.000000000 +0200
@@ -95,4 +95,4 @@
     WeekDaysType
 )
 
-__version__ = '0.32.16'
+__version__ = '0.32.18'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.16/sqlalchemy_utils/aggregates.py 
new/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/aggregates.py
--- old/SQLAlchemy-Utils-0.32.16/sqlalchemy_utils/aggregates.py 2016-04-25 
16:20:06.000000000 +0200
+++ new/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/aggregates.py 2017-10-06 
09:16:18.000000000 +0200
@@ -534,9 +534,9 @@
     def construct_aggregate_queries(self, session, ctx):
         object_dict = defaultdict(list)
         for obj in session:
-            class_ = obj.__class__
-            if class_ in self.generator_registry:
-                object_dict[class_].append(obj)
+            for class_ in self.generator_registry:
+                if isinstance(obj, class_):
+                    object_dict[class_].append(obj)
 
         for class_, objects in object_dict.items():
             for aggregate_value in self.generator_registry[class_]:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.16/sqlalchemy_utils/functions/database.py 
new/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/functions/database.py
--- old/SQLAlchemy-Utils-0.32.16/sqlalchemy_utils/functions/database.py 
2017-03-27 15:46:49.000000000 +0200
+++ new/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/functions/database.py 
2017-10-06 09:16:18.000000000 +0200
@@ -453,7 +453,7 @@
 
     url = copy(make_url(url))
     database = url.database
-    if url.drivername.startswith('postgresql'):
+    if url.drivername.startswith('postgres'):
         url.database = 'template1'
     else:
         url.database = None
@@ -515,7 +515,7 @@
 
     database = url.database
 
-    if url.drivername.startswith('postgresql'):
+    if url.drivername.startswith('postgres'):
         url.database = 'template1'
     elif not url.drivername.startswith('sqlite'):
         url.database = None
@@ -572,7 +572,7 @@
 
     database = url.database
 
-    if url.drivername.startswith('postgresql'):
+    if url.drivername.startswith('postgres'):
         url.database = 'template1'
     elif not url.drivername.startswith('sqlite'):
         url.database = None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.16/sqlalchemy_utils/types/uuid.py 
new/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/types/uuid.py
--- old/SQLAlchemy-Utils-0.32.16/sqlalchemy_utils/types/uuid.py 2016-04-25 
16:20:06.000000000 +0200
+++ new/SQLAlchemy-Utils-0.32.18/sqlalchemy_utils/types/uuid.py 2017-09-29 
12:32:21.000000000 +0200
@@ -3,7 +3,7 @@
 import uuid
 
 from sqlalchemy import types
-from sqlalchemy.dialects import postgresql
+from sqlalchemy.dialects import mssql, postgresql
 
 from .scalar_coercible import ScalarCoercible
 
@@ -40,6 +40,10 @@
             # Use the native UUID type.
             return dialect.type_descriptor(postgresql.UUID())
 
+        if dialect.name == 'mssql' and self.native:
+            # Use the native UNIQUEIDENTIFIER type.
+            return dialect.type_descriptor(mssql.UNIQUEIDENTIFIER())
+
         else:
             # Fallback to either a BINARY or a CHAR.
             kind = self.impl if self.binary else types.CHAR(32)
@@ -63,7 +67,7 @@
         if not isinstance(value, uuid.UUID):
             value = self._coerce(value)
 
-        if self.native and dialect.name == 'postgresql':
+        if self.native and dialect.name in ('postgresql', 'mssql'):
             return str(value)
 
         return value.bytes if self.binary else value.hex
@@ -72,7 +76,7 @@
         if value is None:
             return value
 
-        if self.native and dialect.name == 'postgresql':
+        if self.native and dialect.name in ('postgresql', 'mssql'):
             if isinstance(value, uuid.UUID):
                 # Some drivers convert PostgreSQL's uuid values to
                 # Python's uuid.UUID objects by themselves
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SQLAlchemy-Utils-0.32.16/tests/aggregate/test_join_table_inheritance.py 
new/SQLAlchemy-Utils-0.32.18/tests/aggregate/test_join_table_inheritance.py
--- old/SQLAlchemy-Utils-0.32.16/tests/aggregate/test_join_table_inheritance.py 
2016-04-25 16:20:06.000000000 +0200
+++ new/SQLAlchemy-Utils-0.32.18/tests/aggregate/test_join_table_inheritance.py 
2017-10-06 09:16:18.000000000 +0200
@@ -13,11 +13,34 @@
         id = sa.Column(sa.Integer, primary_key=True)
         name = sa.Column(sa.Unicode(255))
         price = sa.Column(sa.Numeric)
+        type = sa.Column(sa.String(255))
+
+        __mapper_args__ = {
+            'polymorphic_on': type,
+            'polymorphic_identity': 'simple'
+        }
 
         catalog_id = sa.Column(sa.Integer, sa.ForeignKey('catalog.id'))
     return Product
 
 
+@pytest.fixture(params=['simple', 'child'])
+def AnyProduct(Product, request):
+    if request.param == 'simple':
+        return Product
+
+    class ChildProduct(Product):
+        __tablename__ = 'child_product'
+        id = sa.Column(
+            sa.Integer, sa.ForeignKey(Product.id), primary_key=True
+        )
+
+        __mapper_args__ = {
+            'polymorphic_identity': 'child',
+        }
+    return ChildProduct
+
+
 @pytest.fixture
 def Catalog(Base, Product):
     class Catalog(Base):
@@ -67,7 +90,7 @@
 
 
 @pytest.fixture
-def init_models(Product, Catalog, CostumeCatalog, CarCatalog):
+def init_models(AnyProduct, Catalog, CostumeCatalog, CarCatalog):
     pass
 
 
@@ -86,13 +109,13 @@
         assert not hasattr(CarCatalog.__table__.c, 'net_worth')
         assert not hasattr(CostumeCatalog.__table__.c, 'net_worth')
 
-    def test_assigns_aggregates_on_insert(self, session, Product, Catalog):
+    def test_assigns_aggregates_on_insert(self, session, AnyProduct, Catalog):
         catalog = Catalog(
             name=u'Some catalog'
         )
         session.add(catalog)
         session.commit()
-        product = Product(
+        product = AnyProduct(
             name=u'Some product',
             price=Decimal('1000'),
             catalog=catalog
@@ -102,13 +125,13 @@
         session.refresh(catalog)
         assert catalog.net_worth == Decimal('1000')
 
-    def test_assigns_aggregates_on_update(self, session, Catalog, Product):
+    def test_assigns_aggregates_on_update(self, session, Catalog, AnyProduct):
         catalog = Catalog(
             name=u'Some catalog'
         )
         session.add(catalog)
         session.commit()
-        product = Product(
+        product = AnyProduct(
             name=u'Some product',
             price=Decimal('1000'),
             catalog=catalog


Reply via email to