mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Converted IPAddress.interface to a GenericForeignKey
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.4 on 2017-08-16 21:06
|
||||
# Generated by Django 1.11.4 on 2017-08-18 19:46
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import dcim.fields
|
||||
@ -13,9 +13,9 @@ class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('tenancy', '0003_unicode_literals'),
|
||||
('dcim', '0041_napalm_integration'),
|
||||
('ipam', '0018_remove_service_uniqueness_constraint'),
|
||||
('ipam', '0019_ipaddress_interface_to_gfk'),
|
||||
('tenancy', '0003_unicode_literals'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
@ -89,6 +89,7 @@ class Migration(migrations.Migration):
|
||||
('virtual_machine', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='interfaces', to='virtualization.VirtualMachine')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'VM interface',
|
||||
'ordering': ['virtual_machine', 'name'],
|
||||
},
|
||||
),
|
||||
|
@ -221,6 +221,11 @@ class VMInterface(models.Model):
|
||||
max_length=100,
|
||||
blank=True
|
||||
)
|
||||
ip_addresses = GenericRelation(
|
||||
to='ipam.IPAddress',
|
||||
content_type_field='interface_type',
|
||||
object_id_field='interface_id'
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ['virtual_machine', 'name']
|
||||
|
Reference in New Issue
Block a user