detach_object
Remove a reference from a Gramps object, such as an event from a person or a child from a family. The object survives unless delete_if_orphan is set and nothing else references it.
Instructions
Remove a reference from an object: an event from a person, an image from a source, a tag, a note, a child from a family.
The reference is removed; the object itself survives unless delete_if_orphan is set AND nothing else points at it -- which is checked, because deleting something other facts still reference leaves dangling handles behind.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| child | Yes | Handle or gramps_id of the thing to detach. | |
| parent | Yes | Its handle or gramps_id. | |
| child_kind | Yes | What to detach: event, media, note, tag, citation, child (a person from a family), person (a person_ref), or repository. | |
| parent_type | Yes | Type of the object holding the reference. | |
| delete_if_orphan | No | Also delete the detached object if nothing else references it. Off by default -- detaching and deleting are different decisions. |