I have been trying to generate a “family_descend_chart” report in the Gramps webapi.
I had trouble specifying which family to report on.
I tried: “pid”: “F0098” and got ERROR 422: UNPROCESSABLE ENTITY.
Looking into the code (reports.py), I found that option values are checked for validity against the command’s help text. In the case of “pid” (which probably ought to be “fid”; copy/paste error?), each of the valid values identifies a specific family as ID colon tab family-name; e.g. “F0137:\tDoe, John, Smith, Jane”
Having tried using that as the “pid” value (which didn’t work), I looked further and found that the help values are split at the tab, with only the part before the tab being used.
So I tried “F0098:” that is with a colon after the ID.
That successfully passed validation, but failed later on because, of course, there was no family with an ID of “F0098:”.
I tried changing the split on tab to a split on “:\t”, but of course that broke other options which don’t have a colon.
I worked round this by adding "rstrip(‘:’) to the split-on-tab result. That worked!
A simpler way would be not to use a colon in the help text, but I haven’t been able to find where that text is generated.
-
Can you point me at where the help text is generated? Would you consider not using the colon?
-
An alternative is my work-round, but that would affect any options whose values can legitimately end in a colon. Thoughts?