cdc-placement-website-backend/CDC_Backend/APIs/migrations/0016_auto_20231026_1105.py

32 lines
920 B
Python

# Generated by Django 3.2.13 on 2023-10-26 05:35
from django.db import migrations
from django.db.migrations.operations.special import RunPython
def convert_boolean_to_array(apps, schema_editor):
Placement = apps.get_model('APIs', 'Placement')
HistorcalPlacement = apps.get_model('APIs','historicalplacement')
for obj in Placement.objects.all():
if obj.rs_eligible:
obj.allowed_degree = ["bTech","ms/phd","mTech"]
else:
obj.allowed_degree = ["bTech"]
obj.save()
for obj in HistorcalPlacement.objects.all():
if obj.rs_eligible:
obj.allowed_degree = ["bTech","ms/phd","mTech"]
else:
obj.allowed_degree = ["bTech"]
obj.save()
class Migration(migrations.Migration):
dependencies = [
('APIs', '0015_auto_20231026_1051'),
]
operations = [
RunPython(convert_boolean_to_array)
]