Hi everyone, in my script I have to deal with a table whose number of
columns can change at runtime. Since I have no information about the
structure I will have to handle at a given moment, I would need to
change dynamically the mapping during the program. If I try to re-map
the table I obviously get the following error:

sqlalchemy.exc.ArgumentError: Class '<class 'MyMappingClassa'>'
already has a primary mapper defined. Use non_primary=True to create a
non primary Mapper.  clear_mappers() will remove *all* current mappers
from all classes.

On the other hand clear_mappers removes all the mappers that has been
defined on the classes; furthermore, as the documentation says:

clear_mappers` is *not* for normal use, as there is literally no valid
usage for it outside of very specific testing scenarios

Can anyone give a hint to handle correctly this situation or point me
out if there is a better approach to face it?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@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