mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 14:23:36 -06:00
Change max_digits and decimal_places to match Integer instead of BigInteger
This commit is contained in:
parent
7609d290eb
commit
6cc6650b32
@ -73,11 +73,11 @@ class CustomFieldBulkEditForm(BulkEditForm):
|
|||||||
required=False,
|
required=False,
|
||||||
widget=BulkEditNullBooleanSelect()
|
widget=BulkEditNullBooleanSelect()
|
||||||
)
|
)
|
||||||
validation_minimum = forms.IntegerField(
|
validation_minimum = forms.DecimalField(
|
||||||
label=_('Minimum value'),
|
label=_('Minimum value'),
|
||||||
required=False,
|
required=False,
|
||||||
)
|
)
|
||||||
validation_maximum = forms.IntegerField(
|
validation_maximum = forms.DecimalField(
|
||||||
label=_('Maximum value'),
|
label=_('Maximum value'),
|
||||||
required=False,
|
required=False,
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 5.2.4 on 2025-08-28 19:31
|
# Generated by Django 5.2.4 on 2025-09-04 10:50
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
@ -13,11 +13,11 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='customfield',
|
model_name='customfield',
|
||||||
name='validation_maximum',
|
name='validation_maximum',
|
||||||
field=models.DecimalField(blank=True, decimal_places=2, max_digits=21, null=True),
|
field=models.DecimalField(blank=True, decimal_places=4, max_digits=16, null=True),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='customfield',
|
model_name='customfield',
|
||||||
name='validation_minimum',
|
name='validation_minimum',
|
||||||
field=models.DecimalField(blank=True, decimal_places=2, max_digits=21, null=True),
|
field=models.DecimalField(blank=True, decimal_places=4, max_digits=16, null=True),
|
||||||
),
|
),
|
||||||
]
|
]
|
@ -175,16 +175,16 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
|||||||
help_text=_('Fields with higher weights appear lower in a form.')
|
help_text=_('Fields with higher weights appear lower in a form.')
|
||||||
)
|
)
|
||||||
validation_minimum = models.DecimalField(
|
validation_minimum = models.DecimalField(
|
||||||
max_digits=21,
|
max_digits=16,
|
||||||
decimal_places=2,
|
decimal_places=4,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
verbose_name=_('minimum value'),
|
verbose_name=_('minimum value'),
|
||||||
help_text=_('Minimum allowed value (for numeric fields)')
|
help_text=_('Minimum allowed value (for numeric fields)')
|
||||||
)
|
)
|
||||||
validation_maximum = models.DecimalField(
|
validation_maximum = models.DecimalField(
|
||||||
max_digits=21,
|
max_digits=16,
|
||||||
decimal_places=2,
|
decimal_places=4,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
verbose_name=_('maximum value'),
|
verbose_name=_('maximum value'),
|
||||||
@ -475,7 +475,7 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
|||||||
field = forms.DecimalField(
|
field = forms.DecimalField(
|
||||||
required=required,
|
required=required,
|
||||||
initial=initial,
|
initial=initial,
|
||||||
max_digits=12,
|
max_digits=16,
|
||||||
decimal_places=4,
|
decimal_places=4,
|
||||||
min_value=self.validation_minimum,
|
min_value=self.validation_minimum,
|
||||||
max_value=self.validation_maximum
|
max_value=self.validation_maximum
|
||||||
|
Loading…
Reference in New Issue
Block a user