Commit Graph

57 Commits

Author SHA1 Message Date
Jeremy Stretch
de0427a45b Refactor REST API serializers to avoid circular imports 2024-02-27 13:26:43 -05:00
Jeremy Stretch
aea8c693f5 Replace nested serializers with primary serializers where possible 2024-02-26 16:49:30 -05:00
Jeremy Stretch
5c2f7fa59c Closes #15238: Include description field in brief mode 2024-02-26 11:39:31 -05:00
Jeremy Stretch
c9a62ed6bd Closes #15235: Use primary serializers for REST API "brief" mode (#15246)
* Use primary serializers for brief mode

* Remove BriefModeMixin

* Correct ModuleBayTest brief_fields (see #15243)
2024-02-23 14:21:25 -05:00
Jeremy Stretch
aee02c168c 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
Jeremy Stretch
e6c07607d6 Closes #14156: Add custom field support for contact assignments 2023-11-09 16:10:14 -05:00
Abhimanyu Saharan
fbe637cb4e Adds tags on contact assignment (#13328)
* adds tags on contact assignments #12882

* updated migration

* added tags on import form

* adds TagsMixin on ContactAssignmentType #12882

* Misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-01 11:52:14 -04:00
Arthur Hanson
cac9108f5b Closes #9608: Move from drf-yasg to spectacular
Co-authored-by: arthanson <worldnomad@gmail.com>
Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-03-30 14:32:59 -04:00
Jeremy Stretch
acc750ad70 Closes #10545: Standardize description & comment fields on primary models (#10834)
* Standardize description & comments fields on primary models

* Update REST API serializers

* Update forms

* Update tables

* Update templates
2022-11-04 08:28:09 -04:00
Andreas Nieß
022fbd7b75 Fixes #9895: Change DictField serializers to JSONField 2022-08-29 08:02:38 +02:00
jeremystretch
46909071ba Merge branch 'develop' into feature 2022-07-20 12:20:33 -04:00
jeremystretch
ccbdc6f2b9 Define NESTED_SERIALIZER_PREFIX constant 2022-07-15 15:31:42 -04:00
jeremystretch
a6e3eaa772 Clean up core API imports 2022-07-13 16:18:55 -04:00
jeremystretch
e8cfefad09 Fixes #9311: Permit creating contact assignment without a priority via the REST API 2022-05-06 09:25:40 -04:00
jeremystretch
ee3a6baba4 Closes #8593: Add link field to contact model 2022-03-30 16:19:12 -04:00
jeremystretch
c813f56a27 Refactor API serializers 2022-03-09 10:59:22 -05:00
jeremystretch
5d0de68420 Fixes #8051: Contact group parent assignment should not be required under REST API 2021-12-13 08:22:48 -05:00
jeremystretch
406a565f47 Fixes #7771: Group assignment should be optional when creating contacts via REST API 2021-11-08 08:34:10 -05:00
jeremystretch
d5beaad74f #1344: Add missing object field to ContactAssignmentSerializer 2021-11-03 16:27:43 -04:00
jeremystretch
bfc52b15bb Add tags to organizational & nested group models 2021-10-21 10:51:02 -04:00
jeremystretch
7bddc2f34b Cleanup and documentation for #1344 2021-10-18 16:20:31 -04:00
jeremystretch
169996fece Initial work on contacts 2021-10-18 13:59:05 -04:00
Jeremy Stretch
fdaa4a6eb8 Add 'display' field to all REST API serializers 2021-03-16 10:06:25 -04:00
Jeremy Stretch
ae80b4f5f4 Clean up base serializers 2021-03-12 13:31:28 -05:00
Jeremy Stretch
8de5fa0ae2 Introduce NestedGroupModelSerializer 2021-02-25 17:15:42 -05:00
Jeremy Stretch
ec5da40a4a Add custom field support for organizational models to API serializers 2021-02-25 15:58:13 -05:00
pgnuta
944a2bcec5 Update serializers.py
Group should be nullable via API to match frontend functionality and Swagger documentation.
2021-02-11 11:49:57 +13:00
Jeremy Stretch
219d07f997 Reorganize REST API components under netbox app 2020-10-13 15:57:21 -04:00
Jeremy Stretch
1a6267e89a Closes #4837: Use dynamic form widget for relationships to MPTT objects 2020-07-09 09:50:01 -04:00
Jeremy Stretch
5909a9b01e Closes #4806: Add a url field to all API serializers 2020-07-06 16:41:08 -04:00
Jeremy Stretch
0b165e12a8 Replace TaggitSerializer and TagListSerializerField with TaggedObjectSerializer 2020-06-17 09:57:17 -04:00
Jeremy Stretch
97ecfee3d1 Add a description field to all organizational models 2020-03-13 16:33:28 -04:00
Jeremy Stretch
5cda553302 Implement support for nested TenantGroups 2020-03-11 21:12:55 -04:00
Fredrik Lönnegren
2b9fc8d7e1 Add tenancy to cluster
fix pep8
2019-10-07 16:20:14 +02:00
Jeremy Stretch
a5bbd95093 Added '*_count' fields for child objects 2019-04-19 16:50:42 -04:00
Jeremy Stretch
e8d09e97fa Added child counts to API serializers (WIP) 2019-04-12 17:07:56 -04:00
Jeremy Stretch
9a4f3453fb Closes #2578: Reorganized nested serializers 2018-11-12 11:36:44 -05:00
Jeremy Stretch
68a5dcd47e Removed Python 2 string compatibility 2018-08-14 11:58:42 -04:00
Jeremy Stretch
e6e5b92e00 Adopt django-taggit-serializer for representation of assigned tags in the API 2018-08-03 09:43:03 -04:00
Jeremy Stretch
e08d8c4cac Implemented tags for all primary models 2018-05-10 12:53:11 -04:00
Jeremy Stretch
9a8f1c6672 Started merging writable serializers (WIP) 2018-04-04 17:01:24 -04:00
Jeremy Stretch
ce12e30903 Closes #1321: Added created and last_updated fields for relevant models to their API serializers 2017-12-21 10:49:40 -05:00
Jeremy Stretch
6c66a1f72f Fixes #1421: Improved model validation logic for API serializers 2017-08-15 13:54:04 -04:00
Jeremy Stretch
3637939742 Fixes #1285: Enforce model validation when creating/editing objects via the API 2017-07-06 17:37:24 -04:00
Jeremy Stretch
297d9c6bb9 Import unicode_literals 2017-05-24 11:33:11 -04:00
Jeremy Stretch
f739eca0f6 Converted all necessary serializers to CustomFieldModelSerializers 2017-04-27 12:50:43 -04:00
Jeremy Stretch
c072bedd02 Restore not-so-extraneous 'id' field to all WritableSerializers 2017-03-17 17:32:43 -04:00
Jeremy Stretch
a0f931891b Removed extraneous 'id' field from all WritableSerializers 2017-03-17 16:20:34 -04:00
Jeremy Stretch
79c8be97e4 Moved custom field serializers to their own module to avoid circular dependency 2017-03-08 16:18:41 -05:00
Jeremy Stretch
3a9d874d5c Re-implemented CustomFieldSerializer (read-only for now) 2017-02-09 16:55:54 -05:00