He:מדרג מיקום
תכונה שנוספה בגרמפס גרסת 4.1 אוביידטי מקום מאוגדים במדרג החל מגרסת גרמפס 4.1 |
Contents
מבנה מיקומים חדש
אוביקט מקום
במקום להכיל מיקום ראשי, אובייקטי מקום מסודרים כעת במדרג. הם כוללים ארבעה שדות חדשים:
- name
- type
- placeref_list (רשימת מקומות אב)
- code (מיקוד / מספר טלפון)
מקום מקושר למקום-הורה על ידי אובייקטי PlaceRef. אלה מכילים קישור למקום-הורה ולתאריך. למקום מסויים יכולים להיות מספר מקומות-הורה, או, במידה והמקום הוא ברמה העליונה (הוא ההורה) ללא הורים כלל. הערך הראשון ברשימה נחשב כהורה העיקרי.
סוג המקום מאוחסן בGrampsType שנקרא PlaceType.
שדה הקוד מועבר לאחסון קוד המשויך למקום. הקוד יכול להיות קוד מדינה, קיצור מדינה, קוד מחוז דרום וכו '... שדרוג מסד הנתונים יקצה את המיקוד ו / או מספר הטלפון לשדה זה.
פעולות כלים
To obtain a location description for a place, a path to a top-level place must be traversed. There are a few utility functions in gen.utils.location for this purpose:
get_location_list(db, place)
Traverses the hierarchy following the primary parent and returns a list of place names. This can then be formatted using the join method.
', '.join(get_location_list(db, place))
get_main_location(db, place)
This also traverses the hierarchy following the primary parent, but returns a dictionary of place types and names. This can be used to extract a particular place type.
get_main_location(db, place).get(PlaceType.CITY)
get_locations(db, place)
Determines each possible route up the place hierarchy, and returns a list containing dictionaries of place types and names. Each list element represents a separate path up the hierarchy.
מסד נתונים
The Place tree view displays the place hierarchy using primary parents. A new tree cursor provides the view with place records in top-down order, which greatly simplifies the code. Every node in the tree view represents a Gramps place.
To find the children of a place, the existing find_backlink_handles database method can be used. If only primary parents should be followed a new find_place_child_handles method has been provided.
Both the place tree cursor and find_place_child_handles method use an index on the primary parent called place_parent.
ללא שינוי
The place object still contains a title field. This contains a full description of the place and is used in most reports.
Alternate locations have not been converted into new places in the hierarchy.
מה הלאה?
- Do we want to use the new widgets demonstrated in the prototype?
- Should we support Gedcom 5.5EL? See Feature Request:688
ראו גם
- GEPS 006: Better Place handling
- [[Gramps_Template:Version manual_Wiki_Manual_-_Settings#Place_Format_Editor]]