For example:
class Person(object):
name = ""
age = ""
class Address(object):
title = ""
street = ""
city = ""
state = ""
zip = ""
Let's assume I have created two Person objects.
sally = Person()
sally.name = "Sally"
sally.age = 22
john = Person()
john.name = "John"
john.age = 20
If each person had only one address I could easily just put it as an attribute to the person object. However, these people have both a work address and a home address.
sally_work = Address()
sally_work.title = "Work"
sally_work.street = "123 Random Ave"
etc..
sally_home = Address()
sally_home.title = "Home"
sally_home.street = "456 Foo St"
etc..
john_work = Address()
john_work.title = "Work"
john_work.street = "7899 Work Ave"
etc..
john_home = Address()
john_home.title = "Home"
john_home.street = "541 Character Ave"
etc..
Right now these addresses are not connected in any way to their corresponding person objects. In Django I would put person = Models.ForeignKey(Person). My question is what is the equivalent to a ForeignKey in normal Python OOP? Something that'll link each address to it's corresponding Person.
Thank you all in advance!
djangonot insidedjango.