On Nov 12, 11:49 pm, "Florent Aide" <[EMAIL PROTECTED]> wrote: > On Thu, Nov 13, 2008 at 8:42 AM, Eric <[EMAIL PROTECTED]> wrote: > > > person.fullname = kw['assigned_by_name'] > > DBSession.add(person) > > DBSession.flush() > > ai.assigned_by_id = person.id > > log.debug(person.id) > > log.debug(person.fullname) > > > person.fullname = kw['assigned_to_name'] > > DBSession.add(person) > > DBSession.flush() > > ai.assigned_to_id = person.id > > log.debug(person.id) > > log.debug(person.fullname) > > > DBSession.add(ai) > > > My log file shows: > > > 2 > > Name by > > 2 > > Name to > > > and "Name to" was what is stored in the table (with an ID of 2). I > > need both "Name by" and "Name to" stored in the person table. > > You print person.fullname so I'll comment on that first: > > We would need your model to see the details but you write to > person.fullname in both cases, which explains why only one value is > kept... you should have two different attributes (mapped to 2 > different columns in the table) and write in each of them. > > Now for the "ai" part of your exemple: this is unclear. We need a code > snippet (http://paste.turbogears.org) and the model to understand your > question. > > Florent.
Hi, Thanks for your reply. I was assuming that the add, flush combinations was doing something like pushing person.fullname on a stack. Your comment about needing two different attributes was enough of a clue for me to get it working, needed a person_to and person_from object instead of just person. This leads me to another question question, it is unrelated so I will start a new thread. Thanks again, Eric --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

