ObjPersonEdit extends ObjPerson to provide YAML export/import for
contact person records in data_person. Used to back up, migrate, or seed
person definitions across packages and environments.
Unlike most Edit modules, import_from_data does not issue raw SQL
INSERTs. It sets ObjPerson instance attributes and delegates to
ObjPerson.save() (upsert keyed by PersonGuid).
Exported files are written to local.documents/persons/ by default.
ObjPerson.ObjPerson
→ ObjPersonEdit.ObjPersonEdit ← this module
| Table | Purpose |
|---|---|
data_person |
One row per PersonGuid |
Long strings and multi-line values are emitted as YAML block scalars.
None values are stripped. Package is included (persons can be
package-scoped).
PersonGuid: guid-001
Package: homechoice
Name: Alice Smith
Nickname: Alice
User: asmith
Email: alice@example.com
Msisdn: '27820001234'
Role: admin
JobTitle: Senior Engineer
City: Cape Town
Timezone: Africa/Johannesburg
Active: 'Y'
python factory.core/extend.edit/ObjPersonEdit.py save guid-001
python factory.core/extend.edit/ObjPersonEdit.py save guid-001 --filename alice.yaml
python factory.core/extend.edit/ObjPersonEdit.py load guid-001.yaml
python factory.core/extend.edit/ObjPersonEdit.py load guid-001.yaml --package homechoice
| Method | Purpose |
|---|---|
export_to_file(person_guid, filename) |
Export person record to YAML |
import_from_data(data, package) |
Set instance attrs and call save() |
import_from_file(filename, package) |
Import from YAML file |