Re: How to define a "has-a" relationship in dJango models

2009-09-17 Thread PlanetUnknown
Thanks All. Thanks Javier. That makes sense, I'm implementing it via a OneToOe relationship now. On Sep 17, 4:38 am, Tom Evans wrote: > On Wed, 2009-09-16 at 17:15 -0500, Javier Guerra wrote: > > On Wed, Sep 16, 2009 at 1:01 PM, PlanetUnknown > >

Re: How to define a "has-a" relationship in dJango models

2009-09-17 Thread Adam N
> > wrote: > > > > Thanks Karen. > > > Let me explain it a bit more. > > > e.g. > > > All CONTACT details are present in one table - email, home address, > > > work address, home phone, work phone etc. > > > Forget about the statement about growing for now. > > > Since

Re: How to define a "has-a" relationship in dJango models

2009-09-17 Thread Tom Evans
On Wed, 2009-09-16 at 17:15 -0500, Javier Guerra wrote: > On Wed, Sep 16, 2009 at 1:01 PM, PlanetUnknown > wrote: > > > > Thanks Karen. > > Let me explain it a bit more. > > e.g. > > All CONTACT details are present in one table - email, home address, > > work address,

Re: How to define a "has-a" relationship in dJango models

2009-09-16 Thread Craig McClanahan
On Wed, Sep 16, 2009 at 3:15 PM, Javier Guerra wrote: > > On Wed, Sep 16, 2009 at 1:01 PM, PlanetUnknown > wrote: >> >> Thanks Karen. >> Let me explain it a bit more. >> e.g. >> All CONTACT details are present in one table - email, home address, >>

Re: How to define a "has-a" relationship in dJango models

2009-09-16 Thread Javier Guerra
On Wed, Sep 16, 2009 at 1:01 PM, PlanetUnknown wrote: > > Thanks Karen. > Let me explain it a bit more. > e.g. > All CONTACT details are present in one table - email, home address, > work address, home phone, work phone etc. > Forget about the statement about growing

Re: How to define a "has-a" relationship in dJango models

2009-09-16 Thread Karen Tracey
On Wed, Sep 16, 2009 at 2:01 PM, PlanetUnknown wrote: > > Thanks Karen. > Let me explain it a bit more. > e.g. > All CONTACT details are present in one table - email, home address, > work address, home phone, work phone etc. > Forget about the statement about growing

Re: How to define a "has-a" relationship in dJango models

2009-09-16 Thread PlanetUnknown
Thanks Karen. Let me explain it a bit more. e.g. All CONTACT details are present in one table - email, home address, work address, home phone, work phone etc. Forget about the statement about growing for now. Since each user "has-a" contact it is a pure one-to-one relationship and not a

Re: How to define a "has-a" relationship in dJango models

2009-09-16 Thread Karen Tracey
On Wed, Sep 16, 2009 at 10:15 AM, PlanetUnknown wrote: > > For example - User HAS "Contacts"; User HAS "Preferences" > Usually (I'm from an Oracle/Java background) the Contacts table would > have a "user-id" foreign key. > However Django models refer Foreign Key

Re: How to define a "has-a" relationship in dJango models

2009-09-16 Thread PlanetUnknown
The OneToOne relationship seems to be more of an inheritance type of relationship, hence that cannot be used. On Sep 16, 10:28 am, Craig McClanahan wrote: > On Wed, Sep 16, 2009 at 7:15 AM, PlanetUnknown > > wrote: > > > For example - User HAS

Re: How to define a "has-a" relationship in dJango models

2009-09-16 Thread Craig McClanahan
On Wed, Sep 16, 2009 at 7:15 AM, PlanetUnknown wrote: > > For example - User HAS "Contacts"; User HAS "Preferences" > Usually (I'm from an Oracle/Java background) the Contacts table would > have a "user-id" foreign key. > However Django models refer Foreign Key

How to define a "has-a" relationship in dJango models

2009-09-16 Thread PlanetUnknown
For example - User HAS "Contacts"; User HAS "Preferences" Usually (I'm from an Oracle/Java background) the Contacts table would have a "user-id" foreign key. However Django models refer Foreign Key relations as "Many-to-one", but that is not true in my case. There is only one Contact table for a