detach_object
Remove a reference from a Gramps object, such as an event from a person or a child from a family, without deleting the detached record. Optionally delete it if orphaned.
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; a tag may be given by name. | |
| parent | Yes | Its handle or gramps_id. | |
| child_kind | Yes | What to detach: event, media, note, tag (removes a tag), citation, child (a person from a family), person (a person_ref), repository, enclosure (a parent of a place), or -- on a person, to repair a link only the person holds (check_family_links) -- parent_family or family. | |
| call_number | No | Repository only: detach just the link with this call number, when a source is held twice in one repository. Omit to detach every link. | |
| 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. |