[sqlalchemy] Behavior question with association proxy with custom collection class

2008-02-21 Thread Ronald Lew
I was exploring the association proxy example in the documentation and then explored the use of a mapped collection as the custom collection class with mixed results. When attempting to append, an AttributeError _AssociationDict object has no attribute append occurred. Then, I tried subclassing

[sqlalchemy] Re: Behavior question with association proxy with custom collection class

2008-02-21 Thread Ronald Lew
I assume a getset_factory is needed for the association proxy. Any examples? On Feb 21, 8:38 am, Ronald Lew [EMAIL PROTECTED] wrote: I was exploring the association proxy example in the documentation and then explored the use of a mapped collection as the custom collection class with mixed

[sqlalchemy] Collection class using OrderedDict and MappedCollection

2007-12-04 Thread Ronald Lew
I am creating a Collection class using the OrderedDict and MappedCollection with primary key id as the key index. The problem, as noted in the docs, is that the key should be an immutable field. Since I am using a primary key, the value will change when I am instantiating a new object and adding

[sqlalchemy] Overriding mapper relation

2007-11-28 Thread Ronald Lew
I have a customer table which has a 1-to-n relation with a phone table. The phone table has the following columns: integer id, string number, and boolean is_fax. Is there a way to override the phones collection so I can return a boolean if the customer contains at least 1 phone record with a

[sqlalchemy] Using column_property for flagging purpose

2007-11-15 Thread Ronald Lew
I am having issues creating a read-only column using column_property. I have a phone table that has the columns: id, country_code, number, and deleted. I want to have an international column which will be set to True or False (or 1 or 0) depending on the value of the country_code. Provided