implement "new catalog" in editor

This commit is contained in:
Seth Ladygo
2019-05-04 14:44:34 -07:00
parent 7431f23b67
commit 829df7667e
4 changed files with 45 additions and 8 deletions

View File

@ -139,9 +139,9 @@ class Catalog(models.Model):
sections = 0
pages = 0
materials = 0
for section in data.get('sections'):
for section in data.get('sections', []):
sections += 1
for page in section.get('pages'):
for page in section.get('pages', []):
pages += 1
for block in page:
materials += len(block.get('ids', []))