0015_edicto_usuario_movi.py
911 Bytes
# Generated by Django 4.1.9 on 2023-09-12 21:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
def migrar_edicto_usuario_movi(apps, schema):
Edictos = apps.get_model('edicto', 'Edicto')
user_move = 1
for edicto in Edictos.objects.all():
edicto.usuario_movimiento = user_move
edicto.save()
user_move = user_move+1
class Migration(migrations.Migration):
dependencies = [
('edicto', '0014_edicto_usuario_movimiento'),
]
operations = [
migrations.RunPython(migrar_edicto_usuario_movi, reverse_code=migrations.RunPython.noop),
migrations.AlterField(
model_name='edicto',
name='usuario_movimiento',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='udate_edicto', to=settings.AUTH_USER_MODEL)
),
]