mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-14 04:19:36 -06:00
* Initial work to support rackless devices * Updated device component connection forms * Updated IP address assignment form * Updated circuit termination form * Formatting cleanup * Fixed tests
24 lines
530 B
Python
24 lines
530 B
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.10.4 on 2017-02-16 21:23
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations
|
|
|
|
|
|
def copy_site_from_rack(apps, schema_editor):
|
|
Device = apps.get_model('dcim', 'Device')
|
|
for device in Device.objects.all():
|
|
device.site = device.rack.site
|
|
device.save()
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('dcim', '0027_device_add_site'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(copy_site_from_rack),
|
|
]
|