2011/2/1 Michiel Nauta <m.d.nauta@...>
> I am working on bug 4590 and come across method remove_child_from_family
> in gen/db/base.py. The method removes a child with a given handle from a
> family. The thing I do not like about it is that if the family has not
> father and no mother and by removing this child the number of children
> in the family is zero or ONE, that family is removed. Since a family
> object consists of more than just parents and children, but also of
> notes, media objects, etc, I think this is a bit too aggressive. I can
> very well imagine someone wants to have a family where there is only one
> child and he uses the family to store some research note. Is it allowed
> to change the behavior of this method to remove the family only when the
> number of children drops to zero?
Yes, since 3.0/1/2 ?? we support families with no parents, and a lot of code
takes this into account. It is hence a bug in current version that families
with one child get automatically removed now. In this logic it would not be
possible to create a family with no parents as you first will add one child.
> Along the same lines there is a method remove_parent_from_family that
> removes the family again when the number of children is zero or ONE. I
> think this should also change to zero only.
> Finally there is method delete_person_from_database. If the person to be
> removed is a parent in a family and by its removal a family is left with
> no parents nor children, that family is removed. That is correct
> behavior in my eyes.
> But when the person to be removed is a child in a family, that family
> will never be removed. May I change this to: remove the family if it
> doesn't have any children, nor parents?
yes, this seems plausible. You can do this as a patch against branch3.2 if
you want, but if only fixed in trunk then ok for me.
The alternative is never to delete families on change of people in the
family, and a remove empty families tool. It is safe to assume in 99% of the
cases, the family may be removed. There will always be people who delete by
mistake, .... and loose eventref, attributes, ... of the family in the
process. Deleting people is a rare thing however in Gramps, as people mostly
just add information and merge if needed.
> Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
> Finally, a world-class log management solution at an even better
> Download using promo code Free_Logger_4_Dev2Dev. Offer expires
> February 28th, so secure your free ArcSight Logger TODAY!
> Gramps-devel mailing list