Hmm... I must be missing something then in the mapping
This is the error I'm getting:
"AttributeError: 'Z' object has no attribute '__composite_values__'"
How do I do the mapping so that the Z instances map to the respective
composite tables correctly?
I assume then I do not want to use "composite" in the mapping?
#
# MAPPING
#
mapper(A,composite_table_A,properties={
'a_z':composite(Z,composite_table_A.c.z1)})
mapper(B,composite_table_B,properties={
'b_z':composite(Z,composite_table_B.c.z2)})
mapper(C,composite_table_C,properties={
'c_z':composite
(Z,composite_table_C.c.z1,composite_table_C.c.z2)})
On Aug 24, 11:32 am, "Michael Bayer" <[email protected]> wrote:
> hal_robertson wrote:
> > AttributeError: 'Z' object has no attribute '__composite_values__'
>
> > using sqlalchemy.orm.composite to map instances of Z to composite
> > tables
> > requires that Z define __init__, __composite_values__, and ideally
> > __set_composite_values__, and __eq__, which are specific to how Z is
> > mapped
>
> why is that the case ? Z only needs to deal with its z1 and z2
> attributes. its a value object, just like any int or string value, and
> has no awareness of how it's "mapped".
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---