I’m trying to write an SuperTool filter from events to get information about notes type
Looking at Gramps Data Model it said I can find that in event.note.type but SuperTool tells me the type attribute doesn’t exist:
Could you tell me what is the good description of notes data? (text is ok but not type nor NoteType, notetype, note_type…)
NB: This subject could be an answer to that old post from @Link : Filter by Note Type
The ToDo Gramplet or Report source might give a good hint. Without a doubt, those have to filter Notes based on type.
If you read code, let us know how the Gramplet decides to sort which Note object to show first.
Finally I used NoteCleanup (I did not understand anything about todo gramplet or todo report ) where I’ve find this: db.get_note_from_gramps_id
It works fine, so now I can filter events with to do (or anything else) notes:
(“A faire” is “To Do” in french)
90. Note['A faire'] - 363p
# Valeurs modifiables - début
note_type = 'À faire'
# Valeurs modifiables - fin
gramps_id in events_with_note
events_with_note = 
for note in notes:
read_note = db.get_note_from_gramps_id(note.gramps_id)
if read_note.type == note_type:
As a filter:
<filter name="90. Note['A faire'] - 363p" function="and" comment="363p (E90.363p) - - SuperTool">
<rule class="GenericFilterRule_Event" use_regex="False">
<arg value="gramps_id in events_with_note"/>
<arg value="# Valeurs modifiables - début<br>note_type = 'À faire'<br># Valeurs modifiables - fin<br><br>@include note_type_search_init.py"/>
<arg value="@include note_type_search_statement.py"/>
Hi. It seems that I accidentally forgot to include the “type” attribute for notes in SuperTool.
There is now a new version at isotammi-addons/source/SuperTool at master · Taapeli/isotammi-addons · GitHub which fixes this and has some other changes too.
Thanks for noticing this.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.