Excellent. The 'pass' ConcreteInheritedProperty.merge() method works fine.
Thanks again.
On 8/1/2010 2:24 PM, Michael Bayer wrote:
On Jul 31, 2010, at 7:41 AM, Kent wrote:
When I call merge() on an ArTran object, the merge() method of a
ConcreteInheritedProperty 'artransarchiveid'
that *exists only on ArTranArchive* is being called.
The attribute "artransarchiveid" also exists on your base mapper, since the base mapper is mapped
to a "polymorphic union" of all the subclasses. The ConcreteInheritedProperty is placed on
subclasses which don't have any way to map this attribute, i.e. all your subclasses that are on tables which
don't have that column. This is one of the awkwardnesses to the current system of a concrete map with no
"real" superclass.
If the polymorphic union were generated only against columns that were common
to all subclasses, you wouldn't have such attributes in the end result, but
then each subclass would invoke a second SELECT to load its remaining
attributes (I just tried this to confirm it is the case). If the mapper knew
that only a subset of columns are common to subclasses, and that another bunch
of attributes were only for loading, that could make this cleaner still by not
mapping those extra attributes on the base, but it hasn't been worked out how
that would function or be configured.
(
As an aside, instead of getting a 'NotImplementedError' when
ConcreteInheritedProperty.merge() is called, I am getting "TypeError:
merge() takes exactly 6 arguments (8 given)"
anyway a do-nothing merge() has been added to ConcreteInheritedProperty in
r3b1895a3b736 which allows merge() to work with a concrete mapping.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.