Bumped version

This commit is contained in:
Konsta Vesterinen
2013-09-18 15:54:49 +03:00
parent 1aba09dbf7
commit 4603f71159
4 changed files with 17 additions and 7 deletions

View File

@@ -4,6 +4,12 @@ Changelog
Here you can see the full list of changes between each SQLAlchemy-Utils release. Here you can see the full list of changes between each SQLAlchemy-Utils release.
0.16.16 (2013-09-18)
^^^^^^^^^^^^^^^^^^^^
- Fixed fatal bug in batch fetch join table inheritance handling (not handling one-to-many relations properly)
0.16.15 (2013-09-17) 0.16.15 (2013-09-17)
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^

View File

@@ -56,7 +56,7 @@ for name, requirements in extras_require.items():
setup( setup(
name='SQLAlchemy-Utils', name='SQLAlchemy-Utils',
version='0.16.15', version='0.16.16',
url='https://github.com/kvesteri/sqlalchemy-utils', url='https://github.com/kvesteri/sqlalchemy-utils',
license='BSD', license='BSD',
author='Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen', author='Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen',

View File

@@ -38,7 +38,7 @@ from .types import (
) )
__version__ = '0.16.15' __version__ = '0.16.16'
__all__ = ( __all__ = (

View File

@@ -8,6 +8,10 @@ from sqlalchemy.orm.attributes import (
from sqlalchemy.orm.session import object_session from sqlalchemy.orm.session import object_session
class PathException(Exception):
pass
class with_backrefs(object): class with_backrefs(object):
""" """
Marks given attribute path so that whenever its fetched with batch_fetch Marks given attribute path so that whenever its fetched with batch_fetch
@@ -27,7 +31,7 @@ class Path(object):
self.entities = entities self.entities = entities
self.populate_backrefs = populate_backrefs self.populate_backrefs = populate_backrefs
if not isinstance(self.property, RelationshipProperty): if not isinstance(self.property, RelationshipProperty):
raise Exception( raise PathException(
'Given attribute is not a relationship property.' 'Given attribute is not a relationship property.'
) )
self.fetcher = self.fetcher_class(self) self.fetcher = self.fetcher_class(self)
@@ -65,7 +69,7 @@ class Path(object):
elif isinstance(path, InstrumentedAttribute): elif isinstance(path, InstrumentedAttribute):
attr = path attr = path
else: else:
raise Exception('Unknown path type.') raise PathException('Unknown path type.')
return Path(entities, attr.property, populate_backrefs) return Path(entities, attr.property, populate_backrefs)
@@ -181,7 +185,7 @@ class CompositeFetcher(object):
fetchers[0].path.model == fetcher.path.model fetchers[0].path.model == fetcher.path.model
for fetcher in fetchers for fetcher in fetchers
): ):
raise Exception( raise PathException(
'Each relationship property must have the same class when ' 'Each relationship property must have the same class when '
'using CompositeFetcher.' 'using CompositeFetcher.'
) )
@@ -321,7 +325,7 @@ class Fetcher(object):
) )
return sa.or_(*conditions) return sa.or_(*conditions)
else: else:
raise Exception( raise PathException(
'Could not obtain remote column names.' 'Could not obtain remote column names.'
) )
@@ -354,7 +358,7 @@ class ManyToManyFetcher(Fetcher):
for local, remote in self.prop.local_remote_pairs: for local, remote in self.prop.local_remote_pairs:
for fk in remote.foreign_keys: for fk in remote.foreign_keys:
if fk.column.table in self.prop.parent.tables: if fk.column.table in self.prop.parent.tables:
names.append(fk.parent.name) names.append(remote.name)
return names return names
@property @property