Change data model to versioned tables

This commit is contained in:
Raphael Michel
2015-01-06 16:38:15 +01:00
parent 02c0fcbd1e
commit 3ec770a73a
48 changed files with 267 additions and 1302 deletions

View File

@@ -20,7 +20,7 @@ def availability_handler(sender, **kwargs):
context = kwargs['context'] # NOQA
# Fetch all restriction objects applied to this item
restrictions = list(TimeRestriction.objects.filter(
restrictions = list(TimeRestriction.objects.current.filter(
item=item,
).prefetch_related('variations'))
@@ -79,7 +79,7 @@ def availability_handler(sender, **kwargs):
# Walk through all restriction objects applied to this item
for restriction in restrictions:
applied_to = list(restriction.variations.all())
applied_to = list(restriction.variations.current.all())
# Only take this restriction into consideration if it either
# is directly applied to this variation OR is applied to all