1
- import re
1
+ # Generated by Django 5.2.5 on 2025-08-18 16:57
2
2
3
3
import django .core .validators
4
4
import django .db .models .deletion
5
5
import django .db .models .functions .text
6
- import netbox_custom_objects .models
6
+ import netbox .models .deletion
7
+ import re
7
8
import taggit .managers
8
9
import utilities .json
9
10
import utilities .validators
@@ -15,8 +16,8 @@ class Migration(migrations.Migration):
15
16
initial = True
16
17
17
18
dependencies = [
18
- (' core' , '0012_job_object_type_optional' ),
19
- (' extras' , '0123_journalentry_kind_default' ),
19
+ (" core" , "0018_concrete_objecttype" ),
20
+ (" extras" , "0132_configcontextprofile" ),
20
21
]
21
22
22
23
operations = [
@@ -28,33 +29,7 @@ class Migration(migrations.Migration):
28
29
"indexes" : [],
29
30
"constraints" : [],
30
31
},
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" ,),
58
33
),
59
34
migrations .CreateModel (
60
35
name = "CustomObjectType" ,
@@ -75,9 +50,9 @@ class Migration(migrations.Migration):
75
50
encoder = utilities .json .CustomFieldJSONEncoder ,
76
51
),
77
52
),
53
+ ("description" , models .CharField (blank = True , max_length = 200 )),
54
+ ("comments" , models .TextField (blank = True )),
78
55
("name" , models .CharField (max_length = 100 , unique = True )),
79
- ("description" , models .TextField (blank = True )),
80
- ("schema" , models .JSONField (blank = True , default = dict )),
81
56
("verbose_name_plural" , models .CharField (blank = True , max_length = 100 )),
82
57
(
83
58
"tags" ,
@@ -90,6 +65,7 @@ class Migration(migrations.Migration):
90
65
"verbose_name" : "Custom Object Type" ,
91
66
"ordering" : ("name" ,),
92
67
},
68
+ bases = (netbox .models .deletion .DeleteMixin , models .Model ),
93
69
),
94
70
migrations .CreateModel (
95
71
name = "CustomObjectTypeField" ,
@@ -117,7 +93,7 @@ class Migration(migrations.Migration):
117
93
django .core .validators .RegexValidator (
118
94
flags = re .RegexFlag ["IGNORECASE" ],
119
95
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." ,
121
97
regex = "__" ,
122
98
),
123
99
],
@@ -128,7 +104,7 @@ class Migration(migrations.Migration):
128
104
("description" , models .CharField (blank = True , max_length = 200 )),
129
105
("required" , models .BooleanField (default = False )),
130
106
("unique" , models .BooleanField (default = False )),
131
- ("search_weight" , models .PositiveSmallIntegerField (default = 1000 )),
107
+ ("search_weight" , models .PositiveSmallIntegerField (default = 500 )),
132
108
("filter_logic" , models .CharField (default = "loose" , max_length = 50 )),
133
109
("default" , models .JSONField (blank = True , null = True )),
134
110
("related_object_filter" , models .JSONField (blank = True , null = True )),
@@ -180,6 +156,7 @@ class Migration(migrations.Migration):
180
156
"verbose_name_plural" : "custom object type fields" ,
181
157
"ordering" : ["group_name" , "weight" , "name" ],
182
158
},
159
+ bases = (netbox .models .deletion .DeleteMixin , models .Model ),
183
160
),
184
161
migrations .AddConstraint (
185
162
model_name = "customobjecttype" ,
0 commit comments