Introduce VariationDict to reduce duplicate code

This commit is contained in:
Raphael Michel
2014-10-07 10:25:29 +02:00
parent 421b4d8eca
commit 1ec224049d
6 changed files with 90 additions and 25 deletions

View File

@@ -59,9 +59,7 @@ def availability_handler(sender, **kwargs):
# Make up some unique key for this variation
cachekey = 'timerestriction:%d:%s' % (
item.pk,
",".join(sorted(
[str(v[1].pk) for v in v.items() if v[0] != 'variation']
))
v.identify(),
)
# Fetch from cache, if available