Optimize number of SQL queries (now constant)

This commit is contained in:
Raphael Michel
2014-09-29 18:57:18 +02:00
parent 6e826bb7c5
commit ffd3e52584
2 changed files with 11 additions and 5 deletions

View File

@@ -484,7 +484,7 @@ class Item(models.Model):
for var in all_variations:
key = []
for v in var.values.all():
key.append((v.prop.pk, v.pk))
key.append((v.prop_id, v.pk))
key = hash(tuple(sorted(key)))
variations_cache[key] = var