Kai Diefenbach  committed 8bb040d Merge

Merged 0.6 branch.

  • Participants
  • Parent commits 7be7f9d, 7558db4
  • Branches default

Comments (0)

Files changed (1)

File lfs/catalog/

         # If the property is a select field we want to display the name of the
         # option instead of the id.
+        position = 1
         if property.is_select_field:
                 name = options_mapping[row[1]].name
+                position = options_mapping[row[1]].position
             except KeyError:
                 name = row[1]
         elif property.is_number_field:
                     "id": row[0],
                     "value": value,
                     "name": name,
+                    "position": position,
                     "quantity": amount[row[0]][row[1]],
                     "show_quantity": False,
                 "id": row[0],
                 "value": value,
                 "name": name,
+                "position": position,
                 "quantity": amount[row[0]][row[1]],
                 "show_quantity": True,
         # Sort the values. NOTE: This has to be done here (and not via SQL) as
         # the value field of the property is a char field and can't ordered
         # properly for numbers.
-        values.sort(lambda a, b: cmp(a["value"], b["value"]))
+        values.sort(lambda a, b: cmp(a["position"], b["position"]))
             "id": property_id,