Hi,
I'm using SQLAlchemy 0.28 with Pylons 0.98, and when I define this
structure (abridged, so I'm not sure it will really compile...)
people_table = Table("people", metadata,
Column('id', Integer, primary_key=True),
Column('user_name', String),
Column('first_name', String),
Column('last_name', String),
Column('password', String)
)
phone_numbers_table = Table("phone_numbers", metadata,
Column('id', Integer, primary_key=True),
Column('person_id', Integer, ForeignKey('people.id')),
Column('is_alert_number', Boolean),
Column('type', String),
Column('number', String)
)
class Person(object):
pass
class PhoneNumber(object):
pass
person_mapper = mapper(Person, people_table,
properties = {
'phones' : relation(PhoneNumber, cascade="all, delete-orphan",
backref="person", order_by=desc("is_alert_number"))
})
phone_mapper = mapper(PhoneNumber, phone_numbers_table)
and then do the following with a person:
for n in a_person.phones:
print n.number, n.is_alert_number
I get inconsistent results - at times just about anything can change -
usually the results are right but about one time in three the
is_alert_number is wrong, and occasionally not all the numbers are
listed or the order changes. Removing the "order_by" seems to fix
things.
I've looked through the bug list on Trac, and I've looked through the
group and nothing like this has jumped out at me. Are you interested
and should I try to get a real simplified test case?
cheers,
Geoff
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sqlalchemy
-~--~~~~--~~--~--~---