add catalog build_progress, show_prices, and master

This commit is contained in:
Seth Ladygo
2019-04-25 23:37:33 -07:00
parent 8aec069793
commit 857a9b8741
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,28 @@
# Generated by Django 2.2 on 2019-04-26 05:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('procat2', '0004_auto_20190424_0000'),
]
operations = [
migrations.AddField(
model_name='catalog',
name='build_progress',
field=models.PositiveIntegerField(default=0),
),
migrations.AddField(
model_name='catalog',
name='master',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='catalog',
name='show_prices',
field=models.BooleanField(default=False),
),
]

View File

@ -42,7 +42,9 @@ class Catalog(models.Model):
sections = models.PositiveIntegerField(default=0)
materials = models.PositiveIntegerField(default=0)
data = JSONField(null=True)
# build_progress = models.PositiveIntegerField(default=0)
master = models.BooleanField(default=False)
show_prices = models.BooleanField(default=False)
build_progress = models.PositiveIntegerField(default=0)
# JSONField docs:
# https://docs.djangoproject.com/en/2.2/ref/contrib/postgres/fields/#jsonfield
@ -85,5 +87,8 @@ class Catalog(models.Model):
'pages': self.pages,
'sections': self.sections,
'materials': self.materials,
'master': self.master,
'show_prices': self.show_prices,
'build_progress': self.build_progress,
'pdf': self.pdf_url(),
}