def list(current):
    """List recent hunts."""
    db = current.db
    result = []
    for row in db(db.hunts.id > 0).select(
            orderby=~db.hunts.timestamp
    ):
        result.append(dict(
            hunt_id=row.hunt_id,
            labels=[x for x in row.labels if x],
            flow=row.flow.to_primitive(),
            timestamp=row.timestamp,
            creator=row.creator,
            state=row.state,
            status=row.status.to_primitive()))

    return dict(data=result)