d07 · Snapshot and look up orders (~5 min)
Serialization. Edit drills.py. Standard library only; no model calls, no API key.
def save_orders(orders):
orders maps int order ids to order dicts. Return a JSON snapshot string.
def find_order(snapshot, order_id):
Look an order up in a snapshot from save_orders.
order_id arrives the way models send it: 1002, "1002", " 1002 ", "#1002" or full-width "1002". Return the order dict, or None if there's no such order or the id isn't a whole number.
Failure messages are enough to go on, so leave the tests unread until you submit.