List of Event IDs under a specific category

Is there an easy way to dump a list of event IDs that are under a specific category ID. We’re standing up an internal Indico instance and would like to transfer a handful of categories and all events under those categories to the new instance.

I found how to export/import Events using indico shell and would like to use this but I need a list of event IDs first.


Any help is appreciated.


Event.query.filter(Event.category_chain_overlaps([2])).all() would give you all events that are somewhere within category 2 (including nested subcategories). If you just need the IDs you can use something like [ for e in ...]. around the results from that query.

1 Like