def marshal(self, v):
        orig = [i for i in self.choices if self.choices[i] == v]
        if len(orig) == 1:
            return orig[0]
        elif len(orig) == 0:
            # No such choice
            raise NotImplementedError("No such reverse choice {0} for field {1}.".format(v, self))
        else:
            # Too many choices. We could return one possible choice (e.g. orig[0]).
            raise NotImplementedError("Too many reverse choices {0} for value {1} for field {2}".format(orig, v, self))
{% get_content_positions object as positions %}
dataset/ETHPy150Open hozn/stravalib/stravalib/attributes.py/ChoicesAttribute.marshal--crossover with--dataset/ETHPy150Open callowayproject/django-kamasutra/positions/tests.py/PositionsTestCase.testTTGetContentPositions