def json(self):
        """
        Generate a basic JSON representation of the result.

        The base calculator generates an simple Javascript object that 
        contains a single property, named "result".

        @return: A JSON string with a single object that contains the
            property 'result'.
        """
        if not self.result is None and 'value' in self.result:
            output = { 'result': self.result['value'] }
        else:
            output = { 'result': None }

        return json.dumps( output, use_decimal=True )
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/calculators.py/CalculatorBase.json/original