Skip to content

Commit e40e9cb

Browse files
Closes #11017: increase maximum power draw (#12587)
* Convert power draw/max draw to PositiveIntegerField * Closes #11017: Increase maximum power draw * Rename migration file for clarity --------- Co-authored-by: jeremystretch <[email protected]>
1 parent 21f4761 commit e40e9cb

File tree

3 files changed

+46
-4
lines changed

3 files changed

+46
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Generated by Django 4.1.9 on 2023-05-12 18:46
2+
3+
import django.core.validators
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('dcim', '0171_cabletermination_change_logging'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='powerport',
16+
name='allocated_draw',
17+
field=models.PositiveIntegerField(
18+
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
19+
),
20+
),
21+
migrations.AlterField(
22+
model_name='powerport',
23+
name='maximum_draw',
24+
field=models.PositiveIntegerField(
25+
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
26+
),
27+
),
28+
migrations.AlterField(
29+
model_name='powerporttemplate',
30+
name='allocated_draw',
31+
field=models.PositiveIntegerField(
32+
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
33+
),
34+
),
35+
migrations.AlterField(
36+
model_name='powerporttemplate',
37+
name='maximum_draw',
38+
field=models.PositiveIntegerField(
39+
blank=True, null=True, validators=[django.core.validators.MinValueValidator(1)]
40+
),
41+
),
42+
]

netbox/dcim/models/device_component_templates.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,13 @@ class PowerPortTemplate(ModularComponentTemplateModel):
232232
choices=PowerPortTypeChoices,
233233
blank=True
234234
)
235-
maximum_draw = models.PositiveSmallIntegerField(
235+
maximum_draw = models.PositiveIntegerField(
236236
blank=True,
237237
null=True,
238238
validators=[MinValueValidator(1)],
239239
help_text=_("Maximum power draw (watts)")
240240
)
241-
allocated_draw = models.PositiveSmallIntegerField(
241+
allocated_draw = models.PositiveIntegerField(
242242
blank=True,
243243
null=True,
244244
validators=[MinValueValidator(1)],

netbox/dcim/models/device_components.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -329,13 +329,13 @@ class PowerPort(ModularComponentModel, CabledObjectModel, PathEndpoint):
329329
blank=True,
330330
help_text=_('Physical port type')
331331
)
332-
maximum_draw = models.PositiveSmallIntegerField(
332+
maximum_draw = models.PositiveIntegerField(
333333
blank=True,
334334
null=True,
335335
validators=[MinValueValidator(1)],
336336
help_text=_("Maximum power draw (watts)")
337337
)
338-
allocated_draw = models.PositiveSmallIntegerField(
338+
allocated_draw = models.PositiveIntegerField(
339339
blank=True,
340340
null=True,
341341
validators=[MinValueValidator(1)],

0 commit comments

Comments
 (0)