Person Event Sorting

Hi Everyone,

I’ve been thinking about sorting people events and I’ve got a couple of ideas that I’m willing to work on, I’d just like to get a little feedback before starting.

Right now there are 2 ways to sort events either by Type or by Date. Neither really suits my requirements at this point. What I’d really like to have in place is the ability to define a personal sort order, So I can define how I want my events sort. I’m just starting to learn how everything works, so if I say something that makes no sense, feel free to say so.

There appear to be 2 ways to do this. The simplest way would be to add a table that contains the event types in the preferred order. This would make adding a modified sort as simple as adding a new table, providing an interface to provide the preferred sort order, and then doing a join when doing a sort to the events. I think I could write this as a gramplet???

The second way would be to write a series of if statements that would provide the correct order. This still requires obtaining the order from somewhere, so I’m assuming that I could store it in file somewhere in the .gramps directory. If I go this route is there a correct place to store the file? This direction would not require a modification to the DB it’s self, but the coding would be more involved.

Does anyone have any thoughts before I start trying to code this up? I’d rather not start this in a particular direction if anyone has strong feelings.

Thanks for your input in advance.

Terry

The event references are stored in an ordered list. There is already a Sort Events tool that enables you to sort them.

I suggest you modify this tool to meet your requirements. You can then publish it as a third-party addon, and if it is popular we may include it in the core code in the future.

HI Nick,

Ok. Let me look at that as a starting point.

Thanks!

Have you made any progress on this topic yet?

Hi Sem,

Python isn’t a language that I already know so I’m having to learn it first.

Regards,

Terry

1 Like

Has there been any progress in the meantime? :slight_smile: