def to_json(self):
        """Return JSON representation for this template"""
        result = {}

        for field in self.fields:
            result[field.name] = field.to_json(self.data.get(field.name))

        return result