summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b88e533)
Previously, we looked in a separate per-hunt table to find the puzzles
for a hunt. Now, instead, we look in the single "turbot" table and
find puzzles for a hunt by looking for items whose PK is
"hunt-<HUNT_ID>" and whose SK starts with "puzzle-".
-ignore = E251, E305, E302, W503, E201, E202, E225, E226, E203
+ignore = E251, E305, E302, W503, E201, E202, E225, E226, E203, W504
hunt_id = hunt['hunt_id']
channel_id = hunt['channel_id']
hunt_id = hunt['hunt_id']
channel_id = hunt['channel_id']
- response = turb.db.Table(hunt_id).scan()
+ response = turb.table.query(
+ KeyConditionExpression=(
+ Key('PK').eq('hunt-{}'.format(hunt_id)) &
+ Key('SK').begins_with('puzzle-')
+ )
+ )
puzzles = response['Items']
hunt_text = "*<{}|{}>*".format(channel_url(channel_id), name)
puzzles = response['Items']
hunt_text = "*<{}|{}>*".format(channel_url(channel_id), name)