Hi,

I got no idea, whether this is possible with SA (version 0.6.4), but I
want to map multiple columns as one list into the resulting object.
I have the following code:

location_table = Table('loc_location', metadata,
        Column('LOC_ID', Integer, primary_key=True),
        Column('LOC_L1', Integer, key='layer1'),
        Column('LOC_L2', Integer, key='layer2'),
        Column('LOC_L3', Integer, key='layer3'),
        Column('LOC_L4', Integer, key='layer4'),
        Column('LOC_L5', Integer, key='layer5'),
        Column('A_Name', String(100), key='name'),
)

class Location(object):
    def __repr__(self):
        return u"<%s>" % self.name

if i then try to do the following:

mapper(Location, location_table, properties={
    'hirachy': column_property([
        location_table.c.layer1,
        location_table.c.layer2,
        ])
    })

It tells me: "AttributeError: 'list' object has no attribute 'label'"

I also tried to use a select, but it then tells me:
"sqlalchemy.exc.OperationalError: (OperationalError) 1241: Operand
should contain 1 column(s)"

Is there any way to achieve that? It would be great, if SA then bushes
back the changes to the list to the database, too.

bye

-- 
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.

Reply via email to