Fixed #86 -- Decide about variations at product creation

This commit is contained in:
Raphael Michel
2016-03-10 22:18:53 +01:00
parent 98e135d0c6
commit ad3eb59e6a
5 changed files with 37 additions and 5 deletions

View File

@@ -211,6 +211,10 @@ class Item(LoggedModel):
return min([q.availability() for q in self.quotas.all()],
key=lambda s: (s[0], s[1] if s[1] is not None else sys.maxsize))
@cached_property
def has_variations(self):
return self.variations.exists()
class ItemVariation(models.Model):
"""