Searching for abstracts in a specific track with indico shell


#1

Hi,

Sorry if this is very obvious.

If I want to find, with indico shell, all abstracts that were submitted to a particular track, how do I do that?

I thought it should be something like

Abstract.query.filter(Abstract.submitted_for_tracks == 35).all()

but then realized that it doesn’t work, since the method returns tracks not track IDs, also there are some abstracts with multiple tracks.

Thanks,
Ying


#2

Dear Ying,

event = Event.get_one(<event_id>)
# get all abstracts submitted for a single track
Abstract.query.with_parent(event).filter(Abstract.submitted_for_tracks.any(Track.id == <track_id>)).all()

# get all abstracts submitted to multiple tracks
Abstract.query.with_parent(event).filter(Abstract.submitted_for_tracks.any(Track.id.in_([<list of track ids>]))).all()

#3

Great, thanks so much!