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

122 Commits

Author SHA1 Message Date
b86c8a9524 Remove utilities.utils.dynamic_import() 2024-03-22 08:59:52 -04:00
ae8df77cc8 Move count_related() & dict_to_filter_params() to utilities.query 2024-03-22 08:59:52 -04:00
950954a3db Move title() from utilities.utils to utilities.string 2024-03-22 08:59:52 -04:00
19bb808936 Move utilities.api.rest_api_server_error() to utilities.error_handlers.handle_rest_api_exception() 2024-03-22 08:59:52 -04:00
99144031b7 Refactor get_view_name() 2024-03-22 08:59:52 -04:00
cd74e040c1 Merge branch 'feature' into 15278-primary-nested-serializers 2024-03-04 16:42:36 -05:00
c6a3fc2407 #12795: Introduce a custom Group model (#15304)
* Rename sequences & indexes after renaming users table

* Migrate from auth.Group to a custom group model

* Delete original groups from auth_group table

* Update object & multi-object custom fields referencing the Group model

* Fix ContentType resolution

* Clean up obsolete logic for view/serializer resolution
2024-03-04 08:29:53 -05:00
c146f5e1b5 Replace nested serializers with primary serializers where possible 2024-02-26 16:49:30 -05:00
7abb2b2ab5 Closes #15131: Dynamic queryset annotations for REST API endpoints (#15152)
* Introduce RelatedObjectCountField

* Introduce get_annotations_for_serializer() and enable dynamic annotations

* Add RelatedObjectCountFields to serializers; remove static annotations from querysets

* Remove annotations cleanup logic from BriefModeMixin

* Annotate type for RelatedObjectCountField

* Remove redundant field on TagSerializer

* Add missing reverse relationship for power feeds to rack

* Refactor RelatedObjectCountField to take a single relationship name
2024-02-15 14:49:27 -05:00
b3f25a400b Closes #15087: Support for specifying a subset of API serializer fields (#15122)
* Enable dynamic field inclusion for REST API serializers

* Recurse through nested serializer when resolving prefetches

* Remove obsolete calls to prefetch_related() for API views

* Remove support for brief_prefetch_fields viewset attribute

* Rename query parameter

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode (#15134)

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode

* Update API test

* Restore get_queryset() on BriefModeMixin, minus prefetch logic

* get_prefetches_for_serializer() should reference serializer field source if set
2024-02-14 09:28:37 -05:00
32083e58c0 Fixes: #14840 - Forces API to use django user model instead of proxy model (#14881)
* Fixes: #14840 - Forces API to use proxy model

* Update tests to use proxy model

* Revert "Update tests to use proxy model"

This reverts commit 1d784cfe5d689a00ae3c75edc56ce226e62e8fc3.

* Revert "Fixes: #14840 - Forces API to use proxy model"

This reverts commit df85cc967c2e951cb02c8ea3b9074dc6bd7dc301.

* More realistic change to resole issue with netboxusers-list

* Revert "More realistic change to resole issue with netboxusers-list"

This reverts commit 15df8082aafbebf32c932c4c38b970851492eea8.

* Fixes: #14840 - Better fix for netboxusers-list

* Swap model for serializer from proxy model
2024-02-05 11:57:30 -05:00
d470848b29 Closes #12246: General cleanup of utilities modules
* Clean up base modules

* Clean up forms modules

* Clean up templatetags modules

* Replace custom simplify_decimal filter with floatformat

* Misc cleanup

* Merge ReturnURLForm into ConfirmationForm

* Clean up import statements for utilities.forms

* Fix field class references in docs
2023-04-14 10:33:53 -04:00
d2fe59ae8f Fixes #7109: Ensure human readability of exceptions raised during REST API requests 2021-09-01 10:43:12 -04:00
05ba54b6d3 Add GraphQL for users and groups 2021-06-29 13:15:10 -04:00
7deabfe9cd Extended GraphQL tests to include all fields 2021-06-29 11:20:54 -04:00
2b359ce1c7 Move rest_api_server_error() to utilities.api 2020-11-10 17:19:14 -05:00
c0c5f52ed9 Reorganize REST API components under netbox app 2020-10-13 15:57:21 -04:00
5677fab2f9 Support bulk operations for both PUT and PATCH 2020-09-22 11:55:46 -04:00
a998c826a8 Introduce BulkUpdateModelMixin; rename BulkDeleteSerializer 2020-09-22 11:50:43 -04:00
6694ec78bc Implement support for bulk deletion of objects via a single REST API request 2020-09-15 13:36:36 -04:00
fd139a77f5 Closes #4997: Introduce OrderedDefaultRouter; move root API views to views.py 2020-08-13 12:49:49 -04:00
84d4b2db77 Clean up resolution of HTTP verbs to permission actions 2020-07-23 13:53:36 -04:00
cb36f9fdb3 Remove restriction enforcement from RestrictedQuerySet 2020-07-23 12:48:03 -04:00
e9199d6ca5 Look for auth model serializers in users app 2020-07-22 11:50:20 -04:00
1dbf776279 Fix handling of ProtectedError exceptions 2020-07-16 13:45:02 -04:00
19d0d6ff10 Closes #4857: Drop support for legacy numeric choice field values 2020-07-15 16:54:33 -04:00
b535608519 Refactor imports 2020-07-09 09:13:58 -04:00
a6b03b8884 Update WritableNestedSerializer to call unrestricted() on RestrictedQuerySets 2020-06-29 10:38:32 -04:00
8412f9481c Force restriction of RestrictedQuerySet even for superusers 2020-06-26 13:18:12 -04:00
5574aaa8cb Tweak restrict() to accept only an action keyword 2020-06-01 10:45:49 -04:00
5b6a6fb63e Move restrict_queryset() function to RestrictedQuerySet 2020-05-29 15:09:08 -04:00
58989b85c8 Introduce restrict_queryset() 2020-05-29 14:12:24 -04:00
814aff78b5 Update ObjectPermission evaluation to support null attrs 2020-05-28 09:39:27 -04:00
fb7446487e Fix up permissions evaluation 2020-05-27 11:31:07 -04:00
a928d337d9 Add object permission support for create/update/delete API views 2020-05-21 10:51:40 -04:00
8c40148ca7 Add object permission tests for get and list API views 2020-05-20 16:47:33 -04:00
aeb32104a4 Enforce object-level permissions for API views 2020-05-14 17:44:46 -04:00
9df238c5f2 Merge branch 'develop' into develop-2.8 2020-03-15 00:18:32 -04:00
ea9de37dd1 Remove FieldChoicesViewSet 2020-03-12 10:48:17 -04:00
a504f5f309 closes #4340 - Enforce unique constraints for device and virtual machine names in the API 2020-03-10 19:15:24 -04:00
2bd3f1fcc3 Merge pull request #4315 from netbox-community/4195-application-logging
Closes #4195: Application logging
2020-03-04 14:39:12 -05:00
406b88777c Add logging for DRF views 2020-03-04 13:32:45 -05:00
7a10748355 Add logging output to API viewsets 2020-03-02 16:52:21 -05:00
9128dc961c Closes #4173: Return graceful error message when webhook queuing fails 2020-02-21 17:21:04 -05:00
7388fa3556 Fixes #4083: Permit nullifying applicable choice fields via API requests 2020-02-10 15:10:33 -05:00
096814dc33 #3880: Define constants for arbitrary values 2020-01-24 14:42:57 -05:00
49f027fae7 Refactor FieldChoicesViewSet; add Interface.type to virtualization _choices endpoint 2020-01-15 09:59:44 -05:00
f0a6c881bc Fix inclusion of legacy IDs on choice fields 2019-12-10 12:07:54 -05:00
a2a6b754be Introduce ChoiceSet class for field choices 2019-11-07 10:33:10 -05:00
6e5d527fec Improve API error handling when a list is given as a choice value
Fixes #3426
2019-08-15 17:16:24 +01:00