mirror of
https://github.com/netbox-community/netbox.git
synced 2025-09-06 06:13: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,
|
||||
widget=BulkEditNullBooleanSelect()
|
||||
)
|
||||
validation_minimum = forms.IntegerField(
|
||||
validation_minimum = forms.DecimalField(
|
||||
label=_('Minimum value'),
|
||||
required=False,
|
||||
)
|
||||
validation_maximum = forms.IntegerField(
|
||||
validation_maximum = forms.DecimalField(
|
||||
label=_('Maximum value'),
|
||||
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
|
||||
|
||||
@ -13,11 +13,11 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='customfield',
|
||||
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(
|
||||
model_name='customfield',
|
||||
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.')
|
||||
)
|
||||
validation_minimum = models.DecimalField(
|
||||
max_digits=21,
|
||||
decimal_places=2,
|
||||
max_digits=16,
|
||||
decimal_places=4,
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name=_('minimum value'),
|
||||
help_text=_('Minimum allowed value (for numeric fields)')
|
||||
)
|
||||
validation_maximum = models.DecimalField(
|
||||
max_digits=21,
|
||||
decimal_places=2,
|
||||
max_digits=16,
|
||||
decimal_places=4,
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name=_('maximum value'),
|
||||
@ -475,7 +475,7 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel):
|
||||
field = forms.DecimalField(
|
||||
required=required,
|
||||
initial=initial,
|
||||
max_digits=12,
|
||||
max_digits=16,
|
||||
decimal_places=4,
|
||||
min_value=self.validation_minimum,
|
||||
max_value=self.validation_maximum
|
||||
|
Loading…
Reference in New Issue
Block a user