new_contents: # -*- coding: utf-8 -*-
  # Generated by Django 1.11.23 on 2020-04-01 18:47
  from __future__ import unicode_literals
  
  from django.db import migrations, models
  import django.db.models.deletion
  
  
  def set_my_defaults(apps, schema_editor):
      Lote = apps.get_model('lotes', 'Lote')
      Op = apps.get_model('lotes', 'Op')
      for lote in Lote.objects.filter(op=None).iterator():
          try:
              op = Op.objects.get(op=lote.op)
          except Op.DoesNotExist:
              continue
          lote.op_obj = op
          lote.save()
  
  
  def reverse_func(apps, schema_editor):
      pass
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('lotes', '0047_lote_op_obj'),
      ]
  
      operations = [
          migrations.RunPython(set_my_defaults, reverse_func),
      ]
  
subject: inicializa op_obj