On Wed, Sep 16, 2009 at 3:15 PM, Javier Guerra <jav...@guerrag.com> wrote:
>
> On Wed, Sep 16, 2009 at 1:01 PM, PlanetUnknown
> <nikhil.kodil...@gmail.com> 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 each user "has-a" contact it is a pure one-to-one relationship
>> and not a one-to-many or many-to-one; each user in the USER table will
>> have only one corresponding entry in the CONTACT table.
>> Does this help explaining the issue ?
>> The above is just an example, the main question is how does one
>> usually implement a "has-a" relationship in dJango.
>
>
> i think a big part of your problem is that you're using java-inspired
> OOP terminology.  it's much easier if you use RDBMS terminology (after
> all, it will all be stored in a RDBMS).  I guess that the Oracle/Java
> systems you're used to show the DB as a persistence system for
> objects, while Django's ORM creates classes that represent the DB.
> same thing, different philosophies.

I'm not much into "my XXX is bigger/stronger/better than your XXX"
games, but it is worth noting that Java based ORM frameworks
(including JPA and Hibernate) definitely understand what a one-to-one
versus a many-to-one relationship means :-).

Craig McClanahan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to