mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
79b19821f6
* Initial work on #5892 * Add site group selection to object edit forms * Add documentation for site groups * Changelog for #5892 * Finish application of site groups to config context
40 lines
1.7 KiB
Python
40 lines
1.7 KiB
Python
import django.core.serializers.json
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import mptt.fields
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('dcim', '0129_interface_parent'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='SiteGroup',
|
|
fields=[
|
|
('created', models.DateField(auto_now_add=True, null=True)),
|
|
('last_updated', models.DateTimeField(auto_now=True, null=True)),
|
|
('custom_field_data', models.JSONField(blank=True, default=dict, encoder=django.core.serializers.json.DjangoJSONEncoder)),
|
|
('id', models.BigAutoField(primary_key=True, serialize=False)),
|
|
('name', models.CharField(max_length=100, unique=True)),
|
|
('slug', models.SlugField(max_length=100, unique=True)),
|
|
('description', models.CharField(blank=True, max_length=200)),
|
|
('lft', models.PositiveIntegerField(editable=False)),
|
|
('rght', models.PositiveIntegerField(editable=False)),
|
|
('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
|
|
('level', models.PositiveIntegerField(editable=False)),
|
|
('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='dcim.sitegroup')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='site',
|
|
name='group',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sites', to='dcim.sitegroup'),
|
|
),
|
|
]
|