Hello,

I'm a sqlalchemy newbie and I'm trying to get a handle on how and
where to do the mappers in my app.

The app consists of a frame > split window > tree control & flat
notebook.

The idea is that when you click on a node in the tree, the record is
opened in a new tab in the flat notebook.

I decided to try and use sqlalchemy orm to handle all the db
operations but I'm having a bit of trouble.

I can get it to open up and disply the first record that I select from
the tree but if I try to open a second (different) record I get the
following error from sqlalchemy:

  File "c:\program files\python25\lib\site-packages\sqlalchemy-0.5.2-
py2.5.egg\sqlalchemy\orm\mapper.py", line 351, in
_configure_class_instrumentation
    self.class_)
sqlalchemy.exc.ArgumentError: Class '<class 'Gui.Person.Person'>'
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.


In my main app I connect to the db, create a session, set up the
metadata and load all the table metadata.

The main app then sets up the frame which proceeds to fill my tree.

When the user clicks on a node a notebook page is created which then
maps the class to the table, reads the record and displays it. That
works fine until I try to create a new instance of the page with a
different record.

In brief the question is, "where in a gui app should I do the
mapping?"

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