From: Nick H. <nic...@ho...> - 2013-06-15 13:29:17
|
On 14/06/13 12:16, AlanD wrote: > Looking at the Family Group report or Reinhard Müller's Family Sheet report, > I would like to have more census data on it. > > It would be useful to display (some or all of) age, occupation and > birthplace from all of the censuses, so that errors and trends can be > spotted. > > Has anyone done this already? Can anyone point me to simple, entry-level > documentation of the database so that I can attempt to modify the code > myself? http://www.gramps-project.org/wiki/index.php?title=Using_database_API http://www.gramps-project.org/docs/gen/gen_lib.html#module-gen.lib > I don't know which fields on which records will contain the data I > want to print. This data is stored in the attributes of the event reference objects. So for a person you need to get a list of event references and then access the attributes and possibly the event itself. Use code similar to: for event_ref in person.get_event_ref_list(): event = db.get_event_from_handle(event_ref.ref) for attr in event_ref.get_attribute_list(): key = attr.get_type() value = attr.get_value() where "person" is the person of interest and "db" is a database instance. Nick. > > > -- > View this message in context: http://gramps.1791082.n4.nabble.com/Census-data-on-Family-reports-tp4660751.html > Sent from the GRAMPS - User mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Gramps-users mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-users |