Hello.  SA newbie here.

I'm using selectable in a mapper for the first time and I'm having
problems.  From what I understand, you can create a select object and
use it in place of a Table object in a mapper.  For example, if you
have these two objects:

schedTable = Table('schedule', metadata, Column('id', Integer,
primary_key=True), Column('aDate', Date))
schedSelect = select([schedTable])

The following two mapper lines will result in a ScheduleClass that
works exactly the same as the other:

mapper(ScheduleClass, schedTable)
mapper(ScheduleClass, schedSelect)

Following this logic, I tried to update one of my mappings with a
select object and received errors.  To see what happened, I've wrote
some simplified code that reproduces the problem and pasted it here:

http://pastebin.com/d5467be2f

When you run the code it succesfully creates the mapper and even
inserts new objects correctly into the database, but when trying to
retrieve data it throws the following error:

sqlalchemy.exc.NoSuchColumnError: "Could not locate column in row for
column 'scheduleType'"

at the following line of code:

schedules = session.query(ApplicationSchedule).all()

What am I doing wrong / don't understand about SQLAlchemy?

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

Reply via email to