Re: creating new objects with references to them

2006-11-02 Thread John Salerno
Dennis Lee Bieber wrote: > I'd keep it -- since the operations to load/save from the database > should probably be methods of that class -- or, at least, the mapping > from instance attributes to the SQL might be... Well, I'm sort of working on a method that just involves a bunch of functi

Re: creating new objects with references to them

2006-11-02 Thread Steve Holden
JohnJSal wrote: > JohnJSal wrote: > > >>Hope that makes sense. It seems like such a common task. > > > Ok, I'm thinking about the suggestion to make a list, but I'm still > confused. Even with a list, how do I access each instance. Would I have > to do it by index? I assume I'd do something lik

Re: creating new objects with references to them

2006-11-02 Thread Steve Holden
JohnJSal wrote: > Steve Holden wrote: > > >> del rec[7] > > > Hmmm, but what if the record can remain open, changes can be made, and > then saved again to the same object? I suppose it isn't necessary to > delete them, right? Man, this stuff gets complicated > Right. Of course, once yo

Re: creating new objects with references to them

2006-11-02 Thread Diez B. Roggisch
> >> Anyway, a simple list of Researchers should suffice for any of these >> purposes, and assuming you want to commit them all in one hit, you have >> a list of objects ready to iterate over. > > Ok, so in making a list does this mean that I won't have a name for > each instance? I just have to

Re: creating new objects with references to them

2006-11-02 Thread JohnJSal
JohnJSal wrote: > Hope that makes sense. It seems like such a common task. Ok, I'm thinking about the suggestion to make a list, but I'm still confused. Even with a list, how do I access each instance. Would I have to do it by index? I assume I'd do something like this: self.records = []# li

Re: creating new objects with references to them

2006-11-02 Thread JohnJSal
Steve Holden wrote: > del rec[7] Hmmm, but what if the record can remain open, changes can be made, and then saved again to the same object? I suppose it isn't necessary to delete them, right? Man, this stuff gets complicated -- http://mail.python.org/mailman/listinfo/python-list

Re: creating new objects with references to them

2006-11-02 Thread Steve Holden
JohnJSal wrote: > Ant wrote: > > >>It all depends on what UI you are using (Web frontend? GUI such as >>Tkinter?) and what your use case is. > > > Making it myself with wxPython. > > >>What is it exactly that you want to do? Create a bunch of Researcher >>objects and then save them in a singl

Re: creating new objects with references to them

2006-11-02 Thread JohnJSal
Ant wrote: > It all depends on what UI you are using (Web frontend? GUI such as > Tkinter?) and what your use case is. Making it myself with wxPython. > > What is it exactly that you want to do? Create a bunch of Researcher > objects and then save them in a single hit? Create a list of > Researc

Re: creating new objects with references to them

2006-11-02 Thread Ant
On Nov 2, 3:15 pm, "JohnJSal" <[EMAIL PROTECTED]> wrote: > It seems like what I want to do is something that programmers deal with > everyday, but I just can't think of a way to do it. Basically, I am > writing a DB front-end and I want a new "Researcher" object to be > created whenever the user

Re: creating new objects with references to them

2006-11-02 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, JohnJSal wrote: > What I don't know how to do is handle this arbitrary number of objects. > When it comes time to save the data to the DB, how do I access each > object (to get the text fields associated with each)? Won't I have to > have given each instance some name? Or i

Re: creating new objects with references to them

2006-11-02 Thread Steve Holden
JohnJSal wrote: > It seems like what I want to do is something that programmers deal with > everyday, but I just can't think of a way to do it. Basically, I am > writing a DB front-end and I want a new "Researcher" object to be > created whenever the user presses the "New Record" button. He can ope

creating new objects with references to them

2006-11-02 Thread JohnJSal
It seems like what I want to do is something that programmers deal with everyday, but I just can't think of a way to do it. Basically, I am writing a DB front-end and I want a new "Researcher" object to be created whenever the user presses the "New Record" button. He can open as many new records at