Commit Graph

114 Commits

Author SHA1 Message Date
Jeremy Stretch
b2857ab559 Rename CustomField.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
Jeremy Stretch
903f02ff01 Rename ContentType proxy model to ObjectType 2024-03-04 08:33:44 -05:00
Jeremy Stretch
284e68ed9d Merge branch 'develop' into feature 2023-12-27 16:34:38 -05:00
Jeremy Stretch
d3cba5dbfc Closes #14240: Increase min/max validation values for custom fields 2023-12-27 15:41:26 -05:00
Jeremy Stretch
11afcb6af8 Fixes #13606: Fix filtering by null for multiselect custom fields 2023-12-27 12:49:31 -05:00
Jeremy Stretch
c49e4c3797 Merge branch 'develop' into feature 2023-12-15 16:52:42 -05:00
Jeremy Stretch
f3d37b2fbe Fixes #14322: Populate default custom field values when instantiating templated device components 2023-12-06 15:21:34 -05:00
Jeremy Stretch
afb8e3c08e #13299: Clean up custom field form field help text 2023-12-01 10:24:12 -05:00
Jeremy Stretch
a7f6b53e9a Closes #13299: Improve options for controlling custom field visibility (#14289)
* Add ui_visible and ui_editable fields

* Extend migration to map new visible/editable values

* Remove ui_visibility field

* Update docs
2023-11-20 13:06:34 -05:00
Jeremy Stretch
d7179282e6 Closes #14153: Filter ContentTypes by supported feature (#14191)
* WIP

* Remove FeatureQuery

* Standardize use of proxy ContentType for models

* Remove TODO

* Correctly filter BookmarksWidget object_types choices

* Add feature-specific object type validation
2023-11-16 12:12:51 -05:00
Jeremy Stretch
6652555b3c Closes #14141: translation cleanup (#14143)
* Translations cleanup

* Tweak variable names; misc string cleanup

* Misc cleanup
2023-10-30 13:38:03 -04:00
sleepinggenius2
cfa03df84f Adds selection custom field labels to UI 2023-10-05 15:02:22 -04:00
Arthur Hanson
524b0c6ab0 12685 use markdown for custom fields added to form (#13828)
* 12685 use markdown for custom fields added to form

* 13809 change markdown to use utilities

* Add help_text for CustomField description indicating Markdown support

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-09-20 14:06:04 -04:00
Arthur Hanson
a7b90acc05 13757 Fix ConfigContext reference to DeviceType (#13804)
* 13757 do prefetch to work around Django issue with vars in init (DeviceType)

* 13757 use self.__dict to access vars in init

* 13757 change test
2023-09-20 09:56:52 -04:00
Daniel Sheppard
b66ada2a60 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
Jeremy Stretch
eaa3212a56 Fixes #13410: Fix rendering of custom choice fields with large numner of choices 2023-08-08 09:32:56 -04:00
Jeremy Stretch
f124b68f0d Closes #13352: Translation support for model verbose names (#13354)
* Update verbose_name & verbose_name_plural Meta attributes on all models

* Alter makemigrations to ignore verbose_name & verbose_name_plural changes
2023-08-03 10:41:10 -04:00
Jeremy Stretch
0baba778db Fixes #13363: Fix API endpoint for custom field choice selector in forms 2023-08-03 08:53:46 -04:00
Arthur Hanson
383fe8bb91 Closes #13132: Wrap verbose_name and other model text with gettext_lazy() (i18n)
---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 11:28:07 -04:00
Jeremy Stretch
d809644c4d 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
Jeremy Stretch
1ab8477642 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
Arthur Hanson
6e14f53aea 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
jeremystretch
8aec517f02 Fixes #12400: Validate default values for object and multi-object custom fields 2023-05-02 09:35:25 -04:00
jeremystretch
f039d36522 Merge branch 'develop' into feature 2023-04-07 13:00:00 -04:00
Arthur Hanson
4a3abab2e0 11746 fix delete custom field (#12092)
* 11746 delete custom field

* 11746 use filter instead of exclude
2023-04-04 16:38:48 -04:00
jeremystretch
eff00fab1e #10729: Cleanup 2023-03-21 09:36:21 -04:00
jeremystretch
5f21d81b4b #8749: Cleanup 2023-03-20 12:42:26 -04:00
Arthur
1a1d6cca7a 8749 clone custom fields 2023-03-14 15:44:16 -04:00
Jeremy Stretch
177843b5e5 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
Jeremy Stretch
0e40cb0a1b Closes #11765: Remove StaticSelect & StaticSelectMultiple (#11767)
* Remove StaticSelect, StaticSelectMultiple form widgets

* Tag custom ChoiceField, MultipleChoiceField classes for removal in v3.6
2023-02-19 20:09:51 -05:00
jeremystretch
b9135cd244 Closes #11737: ChangeLoggedModel should inherit WebhooksMixin 2023-02-19 20:09:51 -05:00
Jeremy Stretch
46004b528e #11711: Use CSVModelChoiceField for custom object fields during CSV import 2023-02-13 17:53:01 -05:00
kkthxbye
f57a1577cf Fixes #11711 - Use CSVModelMultipleChoiceField when importing custom multiple object fields (#11712)
* Fixes #11711 - Use CSVModelMultipleChoiceField when importing custom multiple object fields

* Fix pep8

---------

Co-authored-by: kkthxbye-code <>
2023-02-13 17:49:08 -05:00
jeremystretch
1319a9abdb Closes #10762: Permit selection custom fields to have only one choice 2023-01-25 10:27:05 -05:00
jeremystretch
a69fba423c #10052: Serialize date fields 2022-11-15 16:10:20 -05:00
jeremystretch
6e3e0567e1 #9887: Add missing model documentation links 2022-11-15 11:00:13 -05:00
Arthur
b06845e666 10300 initial translation support use gettext 2022-11-11 08:47:29 -05:00
Jeremy Stretch
68cf700a3e 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
jeremystretch
4a4fea40f5 Merge branch 'develop' into feature 2022-09-30 17:17:18 -04:00
Arthur Hanson
84f997dff4 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
jeremystretch
2f20fa7e08 Fixes #10461: Enable filtering by read-only custom fields in the UI 2022-09-26 16:42:11 -04:00
jeremystretch
93d64dde7a Enable cloning for custom fields & custom links 2022-09-09 16:51:18 -04:00
jeremystretch
23bbdeeda1 Merge branch 'develop' into feature 2022-08-12 10:18:57 -04:00
jeremystretch
0f5ac05cf1 Closes #9161: Pretty print JSON custom field data when editing 2022-08-10 16:12:04 -04:00
jeremystretch
30b7f8f2ae Merge branch 'develop' into feature 2022-08-01 14:42:09 -04:00
jeremystretch
f1f8d2b72b PEP8 cleanup 2022-08-01 09:16:58 -04:00
jeremystretch
58579d8bbc Merge branch 'develop' into feature 2022-07-11 12:58:24 -04:00
jeremystretch
c33a406491 Fixes #9687: Don't restrict custom text field lengths when entering via UI form 2022-07-11 11:12:06 -04:00
jeremystretch
b10ee60dee Changelog & cleanup for #9166 2022-05-24 16:39:05 -04:00
kkthxbye
e4f967e7c6 #9166 - Add UI Visibility setting for custom fields 2022-05-24 10:12:32 +02:00