Commit Graph

131 Commits

Author SHA1 Message Date
Arthur Hanson
ab8140b92c 17406 allow deletion of plugin custom field if plugin removed 2024-09-17 09:26:33 -04:00
Arthur Hanson
9e9b87d49b 17354 fix import with custom-field (#17368)
* 17354 fix import with custom-field

* 17354 change to use kwargs
2024-09-04 16:15:44 -04:00
Jeremy Stretch
a0a199cec3 #8198: Rename CustomField.validation_unique to unique (#17325)
* #8198: Rename CustomField.validation_unique to unique

* Update CustomField model documentation
2024-08-30 13:44:03 -04:00
Jeremy Stretch
15e6822071 Merge branch 'develop' into feature 2024-08-14 10:54:31 -04:00
Jeremy Stretch
f48161920b Fixes #17131: Fix exception when creating object-type custom field without selecting related object type 2024-08-13 08:14:16 -04:00
samk-acw
a3dd5f8e4d Fixes #16782: Add object filtering for custom fields (#16994)
* Fixes #16782: Add object filtering for custom fields

* Add validation for related_object_filter

* Extend documentation & misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-07-29 15:45:48 -04:00
Jeremy Stretch
e929c736c9 Introduce datetime_from_timestamp() utility function 2024-07-16 12:21:50 -04:00
Jeremy Stretch
3d23f9c099 Merge branch 'develop' into feature 2024-07-09 15:16:05 -04:00
Jeremy Stretch
5d650579e5 Fixes #16679: Avoid overwriting custom JSON fields during bulk edit 2024-07-03 08:42:37 -04:00
Jeremy Stretch
8be1a1f042 Closes #8198: Custom field uniqueness (#16661)
* Closes #8198: Implement ability to enforce custom field uniqueness

* Add missing form fields & table columns for validation attributes

* Remove obsolete code
2024-06-25 08:37:10 -04:00
Jeremy Stretch
6c461b5658 Closes #16700: Audit usage of mark_safe() for consistent escaping 2024-06-24 12:33:54 -04:00
Jeremy Stretch
1648b6088a Fixes #13925: Support 'zulu' style timestamps for custom fields 2024-06-14 10:38:09 -04:00
Jeremy Stretch
0571d36f83 Merge branch 'develop' into feature 2024-05-01 16:09:14 -04:00
Jeremy Stretch
532c15455b Fixes #15896: Retain proper formatting for JSON custom field default values 2024-04-30 16:24:26 -04:00
Jeremy Stretch
8c333d3a03 Closes #15547: Add comments field to CustomField model 2024-04-19 15:10:06 -04:00
Jeremy Stretch
68149ecec6 Closes #15357: Rename CustomField.object_type to related_object_type (#15366) 2024-03-09 06:16:17 -05:00
Jeremy Stretch
55f1953a9f #15277: Clean up references to object types in templates 2024-03-04 11:49:39 -05:00
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