Update postmgiration script for equipments

This commit is contained in:
Keannu Bernasol 2023-12-27 16:31:37 +08:00
parent 6d25157c5f
commit 02df5b5ea9

View file

@ -72,12 +72,12 @@ def create_superuser(sender, **kwargs):
) )
if (CREATED): if (CREATED):
print('Created Equipment: ' + data['name']) print('Created Equipment: ' + data['name'])
# Generate 3 equipment instances per SKU # Generate 3 equipment instances per SKU
for x in range(3): for x in range(3):
EQUIPMENT_INSTANCE = EquipmentInstance.objects.create( EQUIPMENT_INSTANCE = EquipmentInstance.objects.create(
equipment=EQUIPMENT, equipment=EQUIPMENT,
status='Available', status='Available',
remarks=data['remarks'] remarks=data['remarks']
) )
print('Created Equipment Instances: ' + print('Created Equipment Instances: ' +
EQUIPMENT_INSTANCE.equipment.name) EQUIPMENT_INSTANCE.equipment.name)