For some reason to me it seems better to do this check in python before creating the doc. I think it's nice to keep the view logic as simple as possible, and have the doc be explicit about emitting `1`. What do you think?