1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

10348 add decimal custom field (#10422)

* 10348 add decimal custom field

* 10348 fix tests

* 10348 add documentation

* Rearrange custom fields to be ordered consistently

* Rename number_field to integer_field for clarity

* Clean up validation logic

* Apply suggested changes from PR

* Store decimal custom field values natively

* Fix filter test

* Update custom field model migrations to use new encoder

Co-authored-by: jeremystretch <jstretch@ns1.com>
This commit is contained in:
Arthur Hanson
2022-09-30 13:03:24 -07:00
committed by GitHub
parent ada5c58acf
commit af8bb0c4b9
26 changed files with 343 additions and 207 deletions

View File

@@ -10,6 +10,7 @@ class CustomFieldTypeChoices(ChoiceSet):
TYPE_TEXT = 'text'
TYPE_LONGTEXT = 'longtext'
TYPE_INTEGER = 'integer'
TYPE_DECIMAL = 'decimal'
TYPE_BOOLEAN = 'boolean'
TYPE_DATE = 'date'
TYPE_URL = 'url'
@@ -23,6 +24,7 @@ class CustomFieldTypeChoices(ChoiceSet):
(TYPE_TEXT, 'Text'),
(TYPE_LONGTEXT, 'Text (long)'),
(TYPE_INTEGER, 'Integer'),
(TYPE_DECIMAL, 'Decimal'),
(TYPE_BOOLEAN, 'Boolean (true/false)'),
(TYPE_DATE, 'Date'),
(TYPE_URL, 'URL'),