Skip to content

Commit c82b47f

Browse files
committed
Squash migrations and bump version to prep for release with NetBox 4.4.0beta1
1 parent 2b9f2b7 commit c82b47f

8 files changed

+18
-158
lines changed

netbox_custom_objects/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ class CustomObjectsPluginConfig(PluginConfig):
7373
name = "netbox_custom_objects"
7474
verbose_name = "Custom Objects"
7575
description = "A plugin to manage custom objects in NetBox"
76-
version = "0.1.0"
76+
version = "0.2.0"
7777
base_url = "custom-objects"
78-
min_version = "4.2.0"
78+
min_version = "4.4.0"
7979
default_settings = {}
8080
required_settings = []
8181
template_extensions = "template_content.template_extensions"

netbox_custom_objects/migrations/0001_initial.py

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import re
1+
# Generated by Django 5.2.5 on 2025-08-18 16:57
22

33
import django.core.validators
44
import django.db.models.deletion
55
import django.db.models.functions.text
6-
import netbox_custom_objects.models
6+
import netbox.models.deletion
7+
import re
78
import taggit.managers
89
import utilities.json
910
import utilities.validators
@@ -15,8 +16,8 @@ class Migration(migrations.Migration):
1516
initial = True
1617

1718
dependencies = [
18-
('core', '0012_job_object_type_optional'),
19-
('extras', '0123_journalentry_kind_default'),
19+
("core", "0018_concrete_objecttype"),
20+
("extras", "0132_configcontextprofile"),
2021
]
2122

2223
operations = [
@@ -28,33 +29,7 @@ class Migration(migrations.Migration):
2829
"indexes": [],
2930
"constraints": [],
3031
},
31-
bases=("contenttypes.contenttype",),
32-
managers=[
33-
(
34-
"objects",
35-
netbox_custom_objects.models.CustomObjectObjectTypeManager(),
36-
),
37-
],
38-
),
39-
migrations.CreateModel(
40-
name="CustomObject",
41-
fields=[
42-
(
43-
"id",
44-
models.BigAutoField(
45-
auto_created=True, primary_key=True, serialize=False
46-
),
47-
),
48-
(
49-
"tags",
50-
taggit.managers.TaggableManager(
51-
through="extras.TaggedItem", to="extras.Tag"
52-
),
53-
),
54-
],
55-
options={
56-
"abstract": False,
57-
},
32+
bases=("core.objecttype",),
5833
),
5934
migrations.CreateModel(
6035
name="CustomObjectType",
@@ -75,9 +50,9 @@ class Migration(migrations.Migration):
7550
encoder=utilities.json.CustomFieldJSONEncoder,
7651
),
7752
),
53+
("description", models.CharField(blank=True, max_length=200)),
54+
("comments", models.TextField(blank=True)),
7855
("name", models.CharField(max_length=100, unique=True)),
79-
("description", models.TextField(blank=True)),
80-
("schema", models.JSONField(blank=True, default=dict)),
8156
("verbose_name_plural", models.CharField(blank=True, max_length=100)),
8257
(
8358
"tags",
@@ -90,6 +65,7 @@ class Migration(migrations.Migration):
9065
"verbose_name": "Custom Object Type",
9166
"ordering": ("name",),
9267
},
68+
bases=(netbox.models.deletion.DeleteMixin, models.Model),
9369
),
9470
migrations.CreateModel(
9571
name="CustomObjectTypeField",
@@ -117,7 +93,7 @@ class Migration(migrations.Migration):
11793
django.core.validators.RegexValidator(
11894
flags=re.RegexFlag["IGNORECASE"],
11995
inverse_match=True,
120-
message="Double underscores are not permitted in custom field names.",
96+
message="Double underscores are not permitted in custom object field names.",
12197
regex="__",
12298
),
12399
],
@@ -128,7 +104,7 @@ class Migration(migrations.Migration):
128104
("description", models.CharField(blank=True, max_length=200)),
129105
("required", models.BooleanField(default=False)),
130106
("unique", models.BooleanField(default=False)),
131-
("search_weight", models.PositiveSmallIntegerField(default=1000)),
107+
("search_weight", models.PositiveSmallIntegerField(default=500)),
132108
("filter_logic", models.CharField(default="loose", max_length=50)),
133109
("default", models.JSONField(blank=True, null=True)),
134110
("related_object_filter", models.JSONField(blank=True, null=True)),
@@ -180,6 +156,7 @@ class Migration(migrations.Migration):
180156
"verbose_name_plural": "custom object type fields",
181157
"ordering": ["group_name", "weight", "name"],
182158
},
159+
bases=(netbox.models.deletion.DeleteMixin, models.Model),
183160
),
184161
migrations.AddConstraint(
185162
model_name="customobjecttype",

netbox_custom_objects/migrations/0002_customobject_created_customobject_last_updated.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

netbox_custom_objects/migrations/0003_delete_customobject.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

netbox_custom_objects/migrations/0004_customobjecttype_comments.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

netbox_custom_objects/migrations/0005_alter_customobjecttype_description.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

netbox_custom_objects/migrations/0006_alter_customobjecttypefield_name_and_more.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

netbox_custom_objects/navigation.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ def __iter__(self):
5252

5353
current_version = version.parse(settings.RELEASE.version)
5454

55-
groups = [(_("Object Types"), (custom_object_type_plugin_menu_item,))]
56-
if current_version >= version.parse("4.3.4"):
57-
groups.append((_("Objects"), CustomObjectTypeMenuItems()))
55+
groups = [
56+
(_("Object Types"), (custom_object_type_plugin_menu_item,)),
57+
(_("Objects"), CustomObjectTypeMenuItems()),
58+
]
5859

5960
menu = PluginMenu(
6061
label=_("Custom Objects"),

0 commit comments

Comments
 (0)