- return get_table_item(turb, "channel_id_index", 'channel_id', channel_id)
-
-def find_hunt_for_hunt_id(turb, hunt_id):
- """Given a hunt ID find the database for for that hunt
-
- Returns None if hunt ID is not found, otherwise a
- dictionary with all fields from the hunt's row in the table,
- (channel_id, active, hunt_id, name, url, sheet_url, etc.).
-
- """
- turbot_table = turb.db.Table("turbot")
-
- response = turbot_table.get_item(Key={'PK': 'hunt-{}'.format(hunt_id)})
+ response = turb.table.query(
+ IndexName = "channel_id_index",
+ KeyConditionExpression=Key("channel_id").eq(channel_id)
+ )