creating new objects with references to them

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Thu Nov 2 16:40:48 CET 2006


In <1162480549.786082.290980 at b28g2000cwb.googlegroups.com>, 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 is there some other way to do
> this? Simply creating a new instance each time the user presses "New
> Record" won't be good enough, because how do I retain a reference to
> that instance over the course of the program, even after a second or
> third instance has been created?

Put your objects into a list.  Each time the user presses the `New` Button
append a new researcher object to it.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list