Make foreign key helpers SA 1.0 compliant
This commit is contained in:
@@ -9,7 +9,9 @@ Here you can see the full list of changes between each SQLAlchemy-Utils release.
|
|||||||
|
|
||||||
- Drop undocumented batch fetch feature. Let's wait until the inner workings of SQLAlchemy loading API is well-documented.
|
- Drop undocumented batch fetch feature. Let's wait until the inner workings of SQLAlchemy loading API is well-documented.
|
||||||
- Fixed GenericRelationshipProperty comparator to work with SA 1.0.x (#139)
|
- Fixed GenericRelationshipProperty comparator to work with SA 1.0.x (#139)
|
||||||
|
- Make all foreign key helpers SA 1.0 compliant
|
||||||
- Make translation_hybrid expression work the same way as SQLAlchemy-i18n translation expressions
|
- Make translation_hybrid expression work the same way as SQLAlchemy-i18n translation expressions
|
||||||
|
- Update SQLAlchemy dependency to 1.0
|
||||||
|
|
||||||
|
|
||||||
0.30.0 (2015-04-15)
|
0.30.0 (2015-04-15)
|
||||||
|
2
setup.py
2
setup.py
@@ -83,7 +83,7 @@ setup(
|
|||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'six',
|
'six',
|
||||||
'SQLAlchemy>=0.9.9',
|
'SQLAlchemy>=1.0',
|
||||||
'total_ordering>=0.1'
|
'total_ordering>=0.1'
|
||||||
if sys.version_info[0] == 2 and sys.version_info[1] < 7 else '',
|
if sys.version_info[0] == 2 and sys.version_info[1] < 7 else '',
|
||||||
'ordereddict>=1.1'
|
'ordereddict>=1.1'
|
||||||
|
@@ -14,7 +14,7 @@ from .orm import get_column_key, get_mapper, get_tables
|
|||||||
def get_foreign_key_values(fk, obj):
|
def get_foreign_key_values(fk, obj):
|
||||||
return dict(
|
return dict(
|
||||||
(
|
(
|
||||||
fk.constraint.columns[index].key,
|
fk.constraint.columns.values()[index].key,
|
||||||
getattr(obj, element.column.key)
|
getattr(obj, element.column.key)
|
||||||
)
|
)
|
||||||
for
|
for
|
||||||
|
@@ -64,7 +64,7 @@ class TestMakeOrderByDeterministic(TestCase):
|
|||||||
def test_string_order_by(self):
|
def test_string_order_by(self):
|
||||||
query = self.session.query(self.User).order_by('name')
|
query = self.session.query(self.User).order_by('name')
|
||||||
query = make_order_by_deterministic(query)
|
query = make_order_by_deterministic(query)
|
||||||
assert_contains('ORDER BY name, "user".id ASC', query)
|
assert_contains('ORDER BY "user".name, "user".id ASC', query)
|
||||||
|
|
||||||
def test_annotated_label(self):
|
def test_annotated_label(self):
|
||||||
query = self.session.query(self.User).order_by(self.User.article_count)
|
query = self.session.query(self.User).order_by(self.User.article_count)
|
||||||
|
@@ -44,7 +44,7 @@ class TestFindNonIndexedForeignKeys(TestCase):
|
|||||||
fks
|
fks
|
||||||
)
|
)
|
||||||
column_names = [
|
column_names = [
|
||||||
column_name for column_name in fks['article'][0].columns
|
column_name for column_name in fks['article'][0].columns.keys()
|
||||||
]
|
]
|
||||||
assert 'category_id' in column_names
|
assert 'category_id' in column_names
|
||||||
assert 'author_id' not in column_names
|
assert 'author_id' not in column_names
|
||||||
|
Reference in New Issue
Block a user