- 0.6.5 Upstream release
This commit is contained in:
parent
663587fb0f
commit
db9615a833
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
SQLAlchemy-0.6.1.tar.gz
|
||||
/SQLAlchemy-0.6.3.tar.gz
|
||||
/SQLAlchemy-0.6.4.tar.gz
|
||||
/SQLAlchemy-0.6.5.tar.gz
|
||||
|
@ -1,126 +1,67 @@
|
||||
Index: SQLAlchemy-0.6.3/test/orm/test_query.py
|
||||
Index: SQLAlchemy-0.6.5/test/orm/test_eager_relations.py
|
||||
===================================================================
|
||||
--- SQLAlchemy-0.6.3.orig/test/orm/test_query.py
|
||||
+++ SQLAlchemy-0.6.3/test/orm/test_query.py
|
||||
@@ -2278,10 +2278,10 @@ class JoinTest(QueryTest, AssertsCompile
|
||||
# this is the first test where we are joining "backwards" - from AdAlias to User even though
|
||||
# the query is against User
|
||||
q = sess.query(User, AdAlias)
|
||||
- l = q.join(AdAlias.user).filter(User.name=='ed')
|
||||
+ l = q.join(AdAlias.user).filter(User.name=='ed').order_by(User.id, AdAlias.id)
|
||||
eq_(l.all(), [(user8, address2),(user8, address3),(user8, address4),])
|
||||
--- SQLAlchemy-0.6.5.orig/test/orm/test_eager_relations.py
|
||||
+++ SQLAlchemy-0.6.5/test/orm/test_eager_relations.py
|
||||
@@ -610,7 +610,7 @@ class EagerTest(_fixtures.FixtureTest, t
|
||||
sel = sa.select([users, addresses.c.email_address],
|
||||
users.c.id==addresses.c.user_id).alias('useralias')
|
||||
mapper(User, sel, properties={
|
||||
- 'orders':relationship(Order, primaryjoin=sel.c.id==orders.c.user_id, lazy='joined')
|
||||
+ 'orders':relationship(Order, primaryjoin=sel.c.id==orders.c.user_id, lazy='joined', order_by=orders.c.id)
|
||||
})
|
||||
mapper(Order, orders)
|
||||
|
||||
- q = sess.query(User, AdAlias).select_from(join(AdAlias, User, AdAlias.user)).filter(User.name=='ed')
|
||||
+ q = sess.query(User, AdAlias).select_from(join(AdAlias, User, AdAlias.user)).filter(User.name=='ed').order_by(User.id, AdAlias.id)
|
||||
eq_(l.all(), [(user8, address2),(user8, address3),(user8, address4),])
|
||||
|
||||
def test_implicit_joins_from_aliases(self):
|
||||
@@ -2636,14 +2636,20 @@ class InstancesTest(QueryTest, AssertsCo
|
||||
Index: SQLAlchemy-0.6.5/test/orm/test_expire.py
|
||||
===================================================================
|
||||
--- SQLAlchemy-0.6.5.orig/test/orm/test_expire.py
|
||||
+++ SQLAlchemy-0.6.5/test/orm/test_expire.py
|
||||
@@ -732,7 +732,7 @@ class ExpireTest(_fixtures.FixtureTest):
|
||||
@testing.resolve_artifact_names
|
||||
def test_expire_all(self):
|
||||
mapper(User, users, properties={
|
||||
- 'addresses':relationship(Address, backref='user', lazy='joined'),
|
||||
+ 'addresses':relationship(Address, backref='user', lazy='joined', order_by=addresses.c.id),
|
||||
})
|
||||
mapper(Address, addresses)
|
||||
|
||||
Index: SQLAlchemy-0.6.5/test/orm/test_mapper.py
|
||||
===================================================================
|
||||
--- SQLAlchemy-0.6.5.orig/test/orm/test_mapper.py
|
||||
+++ SQLAlchemy-0.6.5/test/orm/test_mapper.py
|
||||
@@ -1319,7 +1319,7 @@ class OptionsTest(_fixtures.FixtureTest)
|
||||
def test_eager_degrade(self):
|
||||
"""An eager relationship automatically degrades to a lazy relationship if eager columns are not available"""
|
||||
mapper(User, users, properties=dict(
|
||||
- addresses = relationship(mapper(Address, addresses), lazy='joined')))
|
||||
+ addresses = relationship(mapper(Address, addresses), lazy='joined', order_by=addresses.c.id)))
|
||||
|
||||
sess = create_session()
|
||||
# first test straight eager load, 1 statement
|
||||
Index: SQLAlchemy-0.6.5/test/orm/test_query.py
|
||||
===================================================================
|
||||
--- SQLAlchemy-0.6.5.orig/test/orm/test_query.py
|
||||
+++ SQLAlchemy-0.6.5/test/orm/test_query.py
|
||||
@@ -2739,12 +2739,12 @@ class InstancesTest(QueryTest, AssertsCo
|
||||
sess = create_session()
|
||||
|
||||
# test that contains_eager suppresses the normal outer join rendering
|
||||
- q = sess.query(User).outerjoin(User.addresses).options(contains_eager(User.addresses)).order_by(User.id)
|
||||
+ q = sess.query(User).outerjoin(User.addresses).options(contains_eager(User.addresses)).order_by(User.id, addresses.c.id)
|
||||
self.assert_compile(q.with_labels().statement,
|
||||
"SELECT addresses.id AS addresses_id, addresses.user_id AS addresses_user_id, "\
|
||||
"addresses.email_address AS addresses_email_address, users.id AS users_id, "\
|
||||
"users.name AS users_name FROM users LEFT OUTER JOIN addresses "\
|
||||
- "ON users.id = addresses.user_id ORDER BY users.id"
|
||||
+ "ON users.id = addresses.user_id ORDER BY users.id, addresses.id"
|
||||
, dialect=default.DefaultDialect())
|
||||
|
||||
def go():
|
||||
- assert self.static.user_address_result == q.all()
|
||||
+ result = q.all()
|
||||
+ for user in result:
|
||||
+ user.addresses = sorted(user.addresses, key=lambda x: x.id)
|
||||
+ assert self.static.user_address_result == result
|
||||
self.assert_sql_count(testing.db, go, 1)
|
||||
@@ -2753,7 +2753,7 @@ class InstancesTest(QueryTest, AssertsCo
|
||||
sess.expunge_all()
|
||||
|
||||
adalias = addresses.alias()
|
||||
q = sess.query(User).select_from(users.outerjoin(adalias)).options(contains_eager(User.addresses, alias=adalias))
|
||||
- q = sess.query(User).select_from(users.outerjoin(adalias)).options(contains_eager(User.addresses, alias=adalias))
|
||||
+ q = sess.query(User).select_from(users.outerjoin(adalias)).options(contains_eager(User.addresses, alias=adalias)).order_by(User.id, adalias.c.id)
|
||||
def go():
|
||||
- eq_(self.static.user_address_result, q.order_by(User.id).all())
|
||||
+ result = q.order_by(User.id).all()
|
||||
+ for user in result:
|
||||
+ user.addresses = sorted(user.addresses, key=lambda x: x.id)
|
||||
+ eq_(self.static.user_address_result, result)
|
||||
eq_(self.static.user_address_result, q.order_by(User.id).all())
|
||||
self.assert_sql_count(testing.db, go, 1)
|
||||
sess.expunge_all()
|
||||
|
||||
@@ -2771,21 +2777,21 @@ class MixedEntitiesTest(QueryTest, Asser
|
||||
sel = users.select(User.id.in_([7, 8])).alias()
|
||||
q = sess.query(User)
|
||||
q2 = q.select_from(sel).values(User.name)
|
||||
- eq_(list(q2), [(u'jack',), (u'ed',)])
|
||||
+ eq_(sorted(list(q2)), sorted([(u'jack',), (u'ed',)]))
|
||||
|
||||
q = sess.query(User)
|
||||
q2 = q.order_by(User.id).values(User.name, User.name + " " + cast(User.id, String(50)))
|
||||
- eq_(list(q2), [(u'jack', u'jack 7'), (u'ed', u'ed 8'), (u'fred', u'fred 9'), (u'chuck', u'chuck 10')])
|
||||
+ eq_(sorted(list(q2)), sorted([(u'jack', u'jack 7'), (u'ed', u'ed 8'), (u'fred', u'fred 9'), (u'chuck', u'chuck 10')]))
|
||||
|
||||
q2 = q.join('addresses').filter(User.name.like('%e%')).order_by(User.id, Address.id).values(User.name, Address.email_address)
|
||||
- eq_(list(q2), [(u'ed', u'ed@wood.com'), (u'ed', u'ed@bettyboop.com'), (u'ed', u'ed@lala.com'), (u'fred', u'fred@fred.com')])
|
||||
+ eq_(sorted(list(q2)), sorted([(u'ed', u'ed@wood.com'), (u'ed', u'ed@bettyboop.com'), (u'ed', u'ed@lala.com'), (u'fred', u'fred@fred.com')]))
|
||||
|
||||
q2 = q.join('addresses').filter(User.name.like('%e%')).order_by(desc(Address.email_address)).slice(1, 3).values(User.name, Address.email_address)
|
||||
- eq_(list(q2), [(u'ed', u'ed@wood.com'), (u'ed', u'ed@lala.com')])
|
||||
+ eq_(sorted(list(q2)), sorted([(u'ed', u'ed@wood.com'), (u'ed', u'ed@lala.com')]))
|
||||
|
||||
adalias = aliased(Address)
|
||||
q2 = q.join(('addresses', adalias)).filter(User.name.like('%e%')).values(User.name, adalias.email_address)
|
||||
- eq_(list(q2), [(u'ed', u'ed@wood.com'), (u'ed', u'ed@bettyboop.com'), (u'ed', u'ed@lala.com'), (u'fred', u'fred@fred.com')])
|
||||
+ eq_(sorted(list(q2)), sorted([(u'ed', u'ed@wood.com'), (u'ed', u'ed@bettyboop.com'), (u'ed', u'ed@lala.com'), (u'fred', u'fred@fred.com')]))
|
||||
|
||||
q2 = q.values(func.count(User.name))
|
||||
assert q2.next() == (4,)
|
||||
@@ -2799,7 +2805,7 @@ class MixedEntitiesTest(QueryTest, Asser
|
||||
|
||||
# whereas this uses users.c.xxx, is not aliased and creates a new join
|
||||
q2 = q.select_from(sel).filter(users.c.id==8).filter(users.c.id>sel.c.id).values(users.c.name, sel.c.name, User.name)
|
||||
- eq_(list(q2), [(u'ed', u'jack', u'jack')])
|
||||
+ eq_(sorted(list(q2)), sorted([(u'ed', u'jack', u'jack')]))
|
||||
|
||||
@testing.fails_on('mssql', 'FIXME: unknown')
|
||||
def test_values_specific_order_by(self):
|
||||
Index: SQLAlchemy-0.6.3/test/orm/test_eager_relations.py
|
||||
===================================================================
|
||||
--- SQLAlchemy-0.6.3.orig/test/orm/test_eager_relations.py
|
||||
+++ SQLAlchemy-0.6.3/test/orm/test_eager_relations.py
|
||||
@@ -598,7 +598,9 @@ class EagerTest(_fixtures.FixtureTest, t
|
||||
mapper(Order, orders)
|
||||
|
||||
sess = create_session()
|
||||
- eq_(sess.query(User).first(),
|
||||
+ result = sess.query(User).order_by(User.id).first()
|
||||
+ result.orders = sorted(result.orders, key=lambda x: x.id)
|
||||
+ eq_(result,
|
||||
User(name=u'jack',orders=[
|
||||
Order(address_id=1,description=u'order 1',isopen=0,user_id=7,id=1),
|
||||
Order(address_id=1,description=u'order 3',isopen=1,user_id=7,id=3),
|
||||
Index: SQLAlchemy-0.6.3/test/orm/test_expire.py
|
||||
===================================================================
|
||||
--- SQLAlchemy-0.6.3.orig/test/orm/test_expire.py
|
||||
+++ SQLAlchemy-0.6.3/test/orm/test_expire.py
|
||||
@@ -734,6 +734,8 @@ class ExpireTest(_fixtures.FixtureTest):
|
||||
|
||||
sess = create_session()
|
||||
userlist = sess.query(User).order_by(User.id).all()
|
||||
+ for user in userlist:
|
||||
+ user.addresses = sorted(user.addresses, key=lambda x: x.id)
|
||||
assert self.static.user_address_result == userlist
|
||||
assert len(list(sess)) == 9
|
||||
sess.expire_all()
|
||||
@@ -742,6 +744,8 @@ class ExpireTest(_fixtures.FixtureTest):
|
||||
|
||||
userlist = sess.query(User).order_by(User.id).all()
|
||||
u = userlist[1]
|
||||
+ for user in userlist:
|
||||
+ user.addresses = sorted(user.addresses, key=lambda x: x.id)
|
||||
eq_(self.static.user_address_result, userlist)
|
||||
assert len(list(sess)) == 9
|
||||
|
||||
Index: SQLAlchemy-0.6.3/test/orm/test_mapper.py
|
||||
===================================================================
|
||||
--- SQLAlchemy-0.6.3.orig/test/orm/test_mapper.py
|
||||
+++ SQLAlchemy-0.6.3/test/orm/test_mapper.py
|
||||
@@ -1269,6 +1269,8 @@ class OptionsTest(_fixtures.FixtureTest)
|
||||
# first test straight eager load, 1 statement
|
||||
def go():
|
||||
l = sess.query(User).order_by(User.id).all()
|
||||
+ for user in l:
|
||||
+ user.addresses = sorted(user.addresses, key=lambda x: x.id)
|
||||
eq_(l, self.static.user_address_result)
|
||||
self.sql_count_(1, go)
|
||||
|
||||
|
@ -10,15 +10,16 @@
|
||||
%global srcname SQLAlchemy
|
||||
|
||||
Name: python-sqlalchemy
|
||||
Version: 0.6.4
|
||||
Release: 2%{?dist}
|
||||
Version: 0.6.5
|
||||
Release: 1%{?dist}
|
||||
Summary: Modular and flexible ORM library for python
|
||||
|
||||
Group: Development/Libraries
|
||||
License: MIT
|
||||
URL: http://www.sqlalchemy.org/
|
||||
Source0: http://pypi.python.org/packages/source/S/%{srcname}/%{srcname}-%{version}.tar.gz
|
||||
Patch0: python-sqlalchemy-unittest-order.patch
|
||||
# Submitted upstream: http://www.sqlalchemy.org/trac/ticket/1888
|
||||
Patch0: python-sqlalchemy-unittest-order.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: python2-devel
|
||||
@ -141,6 +142,9 @@ popd
|
||||
%endif # with_python3
|
||||
|
||||
%changelog
|
||||
* Fri Dec 3 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.5-1
|
||||
- 0.6.5 Upstream release
|
||||
|
||||
* Wed Sep 29 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.4-2
|
||||
- Filter out the C extensions from provides
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user