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

72 Commits

Author SHA1 Message Date
634681a72e Fixes #13606: Fix filtering by null for multiselect custom fields 2023-12-27 12:49:31 -05:00
b7cfb2f7d9 Adds csv dialect detection to bulk import view (#13563)
* adds csv dialect detection to bulk import view #13239

* adds sane delimiters for dialect detection #13239

* adds csv delimiter tests #13239

* adds csv delimiter on the form

* pass delimiter to clean_csv method #13239

* fix tests for csv import #13239

* fix tests for csv import #13239

* fix tests for csv import #13239

* fix tests for csv import #13239

* Improve auto-detection of import data format

* Misc cleanup

* Include tab as a supported delimiting character for auto-detection

* Move delimiting chars to a separate constant for easy reference

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-09-12 16:48:40 -04:00
2d1457b94b Fixes: #13682 - Fix custom field exceptions and validation (#13685)
* Fixes: #13682 - Fix custom field exceptions and validation

* Add tests

* Remove default setting for multi-select/multi-object and return slice of choices and annotate.

* Remove redundant default choice valiadtion; introduce values property on CustomFieldChoiceSet

* Refactor test

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-09-06 10:47:18 -04:00
cf1b1a83eb Closes #12194: Add pre-defined custom field choices (#13219)
* Initial work on custom field choice sets

* Rename choices to extra_choices (prep for #12194)

* Remove CustomField.choices

* Add & update tests

* Clean up table columns

* Add order_alphanetically boolean for choice sets

* Introduce ArrayColumn for choice lists

* Show dependent custom fields on choice set view

* Update custom fields documentation

* Introduce ArrayWidget for more convenient editing of choices

* Incorporate PR feedback

* Misc cleanup

* Initial work on predefined choices for custom fields

* Misc cleanup

* Add IATA airport codes

* #13241: Add support for custom field choice labels

* Restore ArrayColumn

* Misc cleanup

* Change extra_choices back to a nested ArrayField to preserve choice ordering

* Hack to bypass GraphQL API test utility absent support for nested ArrayFields
2023-07-28 11:24:21 -04:00
96ea0ac9c7 Closes #12988: Introduce custom field choice sets (#13195)
* Initial work on custom field choice sets

* Rename choices to extra_choices (prep for #12194)

* Remove CustomField.choices

* Add & update tests

* Clean up table columns

* Add order_alphanetically boolean for choice sets

* Introduce ArrayColumn for choice lists

* Show dependent custom fields on choice set view

* Update custom fields documentation

* Introduce ArrayWidget for more convenient editing of choices

* Incorporate PR feedback

* Misc cleanup
2023-07-19 10:26:24 -04:00
21f4761335 12468 disallow double underscores in custom field names (#12523)
* 12468 disallow double underscores in custom field names

* 12468 disallow double underscores in custom field names

* 12468 review changes

* 12468 correct migration

* 12468 use inverse match

* 12468 use inverse match

* Add test for invalid custom field names

---------

Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-05-12 16:08:57 -04:00
206d578bc3 Closes #10242: Redirect to filtered objects list after bulk import (#12001)
* Redirect user to filtered objects list after bulk import

* Remove obsolete table attribute from bulk import views
2023-03-17 09:23:40 -04:00
5517963b24 Closes #10729: Add date & time custom field type (#11857)
* Add datetime custom field type

* Update custom field tests
2023-02-28 13:33:40 -05:00
064e3ff605 Merge branch 'develop' into feature 2022-12-13 17:17:05 -05:00
b9888d6f86 Fixes #11109: Fix nullification of custom object & multi-object fields via REST API 2022-12-13 14:48:40 -05:00
c3dcd8937f Merge branch 'develop' into feature 2022-11-22 10:08:23 -05:00
d5538c1ca3 Fixes #10241: Support referencing custom field related objects by attribute in addition to PK 2022-11-21 12:48:13 -05:00
d4a231585a Clean up tests 2022-11-17 10:50:05 -05:00
23077821f6 #10052: Serialize date fields 2022-11-15 16:10:20 -05:00
23c0ca456f #4347: Rename NetBoxModelCSVForm to NetBoxModelImportForm 2022-11-15 12:24:57 -05:00
93e7457e0d 4347 Add JSON/YAML import support for all objects (#10367)
* 4347 initial code for json import

* 4347 initial code for json import

* Clean up form processing logic

* Consolidate import forms

* Consolidate object import/update logic

* Clean up bulk import view

Co-authored-by: jeremystretch <jstretch@ns1.com>
2022-11-10 11:01:52 -05:00
ea6d86e6c4 Closes #10052: The cf attribute now returns deserialized custom field data 2022-11-04 14:53:18 -04:00
9628dead07 Closes #10560: New global search (#10676)
* Initial work on new search backend

* Clean up search backends

* Return only the most relevant result per object

* Clear any pre-existing cached entries on cache()

* #6003: Implement global search functionality for custom field values

* Tweak field weights & document guidance

* Extend search() to accept a lookup type

* Move get_registry() out of SearchBackend

* Enforce object permissions when returning search results

* Add indexers for remaining models

* Avoid calling remove() on non-cacheable objects

* Use new search backend by default

* Extend search backend to filter by object type

* Clean up search view form

* Enable specifying lookup logic

* Add indexes for value field

* Remove object type selector from search bar

* Introduce SearchTable and enable HTMX for results

* Enable pagination

* Remove legacy search backend

* Cleanup

* Use a UUID for CachedValue primary key

* Refactoring search methods

* Define max search results limit

* Extend reindex command to support specifying particular models

* Add clear() and size to SearchBackend

* Optimize bulk caching performance

* Highlight matched portion of field value

* Performance improvements for reindexing

* Started on search tests

* Cleanup & docs

* Documentation updates

* Clean up SearchIndex

* Flatten search registry to register by app_label.model_name

* Clean up search backend classes

* Clean up RestrictedGenericForeignKey and RestrictedPrefetch

* Resolve migrations conflict
2022-10-21 13:16:16 -04:00
af8bb0c4b9 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>
2022-09-30 16:03:24 -04:00
84f2225f42 PEP8 cleanup 2022-08-01 09:16:58 -04:00
df2f6d4a7d Fixes #8872: Enable filtering by custom object fields 2022-03-23 14:34:42 -04:00
3fcae36cf1 Closes #8307: Add data_type indicator to REST API serializer for custom fields 2022-01-18 16:57:54 -05:00
c8713d94d8 Merge branch 'develop' into feature 2022-01-11 16:16:13 -05:00
7421e5f7d7 Fixes #8317: Fix CSV import of multi-select custom field values 2022-01-11 14:52:47 -05:00
1e80cc6db5 Clean up & extend custom field tests 2022-01-06 13:24:37 -05:00
271b7adeb8 Extend to support the assignment of multiple objects per field 2022-01-05 17:05:54 -05:00
fa1e28e860 Initial work on #7006 2022-01-04 16:59:52 -05:00
05d4176d34 Fixes #8201: Custom integer fields should allow negative integers as minimum/maximum values 2022-01-03 10:07:19 -05:00
696fe7bc0d Add tests for custom field lookups 2021-10-29 09:45:48 -04:00
15e011ae52 Closes #7452: Add JSON custom field type 2021-10-28 10:29:14 -04:00
176bd2396b Closes #6711: Add longtext custom field type with Markdown support 2021-10-14 14:48:00 -04:00
71449b3414 Fixes #7304: Require explicit values for all required choice fields during CSV import 2021-09-28 12:04:54 -04:00
a8cdb3895b Fixes #7093: Multi-select custom field filters should employ exact match 2021-08-31 15:03:39 -04:00
9b0258fef4 Fixes #6686: Force assignment of null custom field values to objects 2021-08-16 14:38:06 -04:00
1024782b9e Rename FilterSet modules 2021-04-29 16:48:24 -04:00
92df40a6a0 Fixes #5652: Update object data when renaming a custom field 2021-04-15 12:04:34 -04:00
b09112941a Fixes #5510: Fix filtering by boolean custom fields 2020-12-21 11:47:11 -05:00
f3f3993963 Enforce custom field validation on the model 2020-11-12 14:23:08 -05:00
4a8a1ce45c Check for extraneous custom field data on clean() 2020-11-12 12:18:31 -05:00
8781cf1c57 Closes #609: Add min/max value and regex validation for custom fields 2020-10-15 15:06:01 -04:00
143f3cc27c #4711: Rename CustomField.obj_type to content_types 2020-10-14 15:26:46 -04:00
a9086b0679 Fix import test 2020-08-25 15:31:01 -04:00
d0f1c733e7 Replace CustomFieldsSerializer with CustomFieldsDataField 2020-08-25 15:22:32 -04:00
f7b8d6ede5 Add choices ArrayField to CustomField; drop CustomFieldChoice 2020-08-25 13:24:46 -04:00
d9e5adc032 Update serializer to access custom_field_data directly 2020-08-25 10:43:04 -04:00
c85a45e520 Further work on custom fields 2020-08-24 14:11:13 -04:00
2276603ac3 Drop CustomFieldValue 2020-08-21 16:21:11 -04:00
a8145fe4c2 Add permission assignment to custom test methods 2020-06-08 13:40:46 -04:00
ce46512c74 Fix permission assignment in tests 2020-05-27 16:53:30 -04:00
745c9a9c2b Add test for CustomFieldManager.get_for_model() 2020-05-08 12:18:08 -04:00