On Friday, April 12, 2013 9:52:10 AM UTC+9:30, Lachlan Musicman wrote:
>
> On 12 April 2013 08:43, Dennis Lee Bieber <wlf...@ix.netcom.com<javascript:>> 
> wrote: 
> > On Thu, 11 Apr 2013 16:41:37 +1000, Lachlan Musicman 
> > <dat...@gmail.com<javascript:>> 
>
> > declaimed the following in gmane.comp.python.django.user: 
> > 
> >         An individual typically only has two parents (unless you are 
> > considering birth and adoption, which may be needed to handle some of 
> > the odd situations forming with the various "same sex marriage" models), 
> > so many-to-many isn't really appropriate. And an individual could have 
> > many children. 
> > 
> >         So I'd have a pair of links for 
> > 
> >                 father 
> >                 mother 
> > 
> > and that is IT... Children and Siblings are all query results (children 
> > of X are those with the appropriate parent slot = X). 
>
>
> I like your reasoning, but I disagree on your result. First, it 
> doesn't relate partners, second, it presumes two parents (I am a step 
> father). 
>

But a partner relationship is not at all related to a parent-child 
relationship.

That is, you may have children with a person who is not your partner. And,
you may have a partner and not have children.

And, you may have more than one partner (depending upon where you are,
you may have more than one partner simultaneously).

If you will only store adoptive OR birth parents, then you can get away with
a single mother and father fields. But, even for adoptive relationships, you
probably need a start date (and possibly a finish date), so I think they 
should
be stored seperately.

Thus, you have:

Person
 - date-of-birth
 - date-of-death
 - mother (fk-> Person)
 - father (fk -> Person)
 - adoptive_parent (m2m -> Person, maybe use a through table
to get start and finish dates).

The issue you have then is that you have two fks to Parent,
which means you would have to query differently to get a father's
children to a mother's. Or you could wrap '.children()' to get the
value.

 

> So I think I'm going to go with a 
>
> parent m2m 
> partner m2m 
>
> and take your advise to trash sibling and children. 
>
> Back to the grindstone then. 
>
>
Or, you could use the parent m2m with a through table to add
the relevant data. birth/adoptive parent, etc.

And, the partner m2m could also use a through table to store
start and finish times of the relationship.

Family relationships are hard...

Matt.

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


Reply via email to