Best Python code snippet using Kiwi_python
0002_add_initial_data.py
Source:0002_add_initial_data.py
1# -*- coding: utf-8 -*-2from __future__ import unicode_literals3from django.db import migrations4def forwards_add_initial_data(apps, schema_editor):5 Priority = apps.get_model('management', 'Priority')6 Priority.objects.bulk_create([7 Priority(value='P1', sortkey=1),8 Priority(value='P2', sortkey=2),9 Priority(value='P3', sortkey=3),10 Priority(value='P4', sortkey=4),11 Priority(value='P5', sortkey=5),12 ])13def reverse_remove_initial_data(apps, schema_editor):14 Priority = apps.get_model('management', 'Priority')15 Priority.objects.filter(value__in=['P1', 'P2', 'P3', 'P4', 'P5']).delete()16class Migration(migrations.Migration):17 dependencies = [18 ('management', '0001_initial'),...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!