Seed data was missing device_id

This commit is contained in:
Patrick McDonagh
2016-12-02 18:36:54 -06:00
parent 315fa9cd8b
commit ad72c83b2f
2 changed files with 10 additions and 10 deletions

View File

@@ -117,11 +117,11 @@ def seed():
stroke_production = Tag(name='Stroke Production', tag_category='poc', tag='Stroke_Production', device_id=1, description='Amount of fluid produced in the current stroke', data_type='REAL', change_threshold=0.005, min_expected=0.00, max_expected=0.01, units='BBL', guarantee_sec=3600)
db.session.add(stroke_production)
num_tapers = BackupRestore(tag="Card_Current.Params.Num_Tapers")
taper_length = [BackupRestore(tag="Taper.Taper[{}].Setup.Length".format(i)) for i in range(1, 10)]
taper_diameter = [BackupRestore(tag="Taper.Taper[{}].Setup.Diameter".format(i)) for i in range(1, 10)]
taper_material = [BackupRestore(tag="Taper.Taper[{}].Setup.Material".format(i)) for i in range(1, 10)]
pump_diameter = BackupRestore(tag='UnitConfig.Pump_Diameter')
num_tapers = BackupRestore(tag="Card_Current.Params.Num_Tapers", device_id=1)
taper_length = [BackupRestore(tag="Taper.Taper[{}].Setup.Length".format(i), device_id=1) for i in range(1, 10)]
taper_diameter = [BackupRestore(tag="Taper.Taper[{}].Setup.Diameter".format(i), device_id=1) for i in range(1, 10)]
taper_material = [BackupRestore(tag="Taper.Taper[{}].Setup.Material".format(i), device_id=1) for i in range(1, 10)]
pump_diameter = BackupRestore(tag='UnitConfig.Pump_Diameter', device_id=1)
db.session.add(num_tapers)
for i in range(0, len(taper_length)):

View File

@@ -6,11 +6,11 @@ from app import db
# how else would it know what to create ?
from app.datalogger.models import *
num_tapers = BackupRestore(tag="Card_Current.Params.Num_Tapers")
taper_length = [BackupRestore(tag="Taper.Taper[{}].Setup.Length".format(i)) for i in range(1, 10)]
taper_diameter = [BackupRestore(tag="Taper.Taper[{}].Setup.Diameter".format(i)) for i in range(1, 10)]
taper_material = [BackupRestore(tag="Taper.Taper[{}].Setup.Material".format(i)) for i in range(1, 10)]
pump_diameter = BackupRestore(tag='UnitConfig.Pump_Diameter')
num_tapers = BackupRestore(tag="Card_Current.Params.Num_Tapers", device_id=1)
taper_length = [BackupRestore(tag="Taper.Taper[{}].Setup.Length".format(i), device_id=1) for i in range(1, 10)]
taper_diameter = [BackupRestore(tag="Taper.Taper[{}].Setup.Diameter".format(i), device_id=1) for i in range(1, 10)]
taper_material = [BackupRestore(tag="Taper.Taper[{}].Setup.Material".format(i), device_id=1) for i in range(1, 10)]
pump_diameter = BackupRestore(tag='UnitConfig.Pump_Diameter', device_id=1)
db.session.add(num_tapers)
for i in range(0, len(taper_length)):