mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 03:13:12 +00:00
c4a104b3b6
Just ran black on the whoe repository. Fix #210.
26 lines
819 B
Python
26 lines
819 B
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.10.7 on 2017-12-31 19:53
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [("topologie", "0039_port_new_switch")]
|
|
|
|
def transfer_port(apps, schema_editor):
|
|
db_alias = schema_editor.connection.alias
|
|
port = apps.get_model("topologie", "Port")
|
|
switch = apps.get_model("topologie", "NewSwitch")
|
|
port_list = port.objects.using(db_alias).all()
|
|
for p in port_list:
|
|
p.new_switch = switch.objects.filter(
|
|
interface_ptr=p.switch.switch_interface
|
|
).first()
|
|
p.save()
|
|
|
|
def untransfer_port(apps, schema_editor):
|
|
return
|
|
|
|
operations = [migrations.RunPython(transfer_port, untransfer_port)]
|