Example #1
0
 def to_representation(self, obj):
     ret = {}
     if obj is not None:
         # Make it work two different ways.. ooooh
         if isinstance(obj, models.Stack):
             ret = obj.properties
         else:
             ret = obj
     return recursively_sort_dict(ret)
Example #2
0
    def retrieve(self, request, *args, **kwargs):
        formula = self.get_object()

        # determine if a version was specified
        version = request.query_params.get('version')

        if version not in formula.get_valid_versions():
            version = formula.default_version

        properties = formula.properties(version)

        return Response(recursively_sort_dict(properties))
Example #3
0
    def retrieve(self, request, *args, **kwargs):
        formula = self.get_object()

        # determine if a version was specified
        version = request.query_params.get('version')

        if version not in formula.get_valid_versions():
            version = formula.default_version

        properties = formula.properties(version)

        return Response(recursively_sort_dict(properties))
Example #4
0
 def to_representation(self, obj):
     ret = {}
     if obj is not None:
         ret = obj.global_orchestration_properties
     return recursively_sort_dict(ret)
Example #5
0
 def to_representation(self, value):
     ret = super(PropertiesField, self).to_representation(value)
     return utils.recursively_sort_dict(ret)
Example #6
0
 def to_representation(self, instance):
     return utils.recursively_sort_dict(instance.properties)
Example #7
0
 def to_representation(self, obj):
     ret = {}
     if obj is not None:
         ret = obj.global_orchestration_properties
     return recursively_sort_dict(ret)