Remove ExtraMetadata in favor of SparseFields#14001
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Copilot on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added. |
…ata model Co-authored-by: etj <717359+etj@users.noreply.github.com>
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Copilot on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added. |
|
@copilot format with back, checks are failing because of it |
Co-authored-by: etj <717359+etj@users.noreply.github.com>
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @Copilot on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added. |
Fixed in cfc914c. The flake8 errors were:
|
ExtraMetadatawas a stopgap for storing custom per-resource metadata. With the metadata JSON schema system andSparseFieldnow available,ExtraMetadatais superseded and can be removed.Migration
A single migration (
0098) handles both data and schema changes:ExtraMetadatarow is migrated to aSparseFieldentry withname=extra_metadata_<pk>andvalue=json.dumps(metadata_dict). Entries whose serialized JSON exceeds the 1024-charSparseField.valuelimit are skipped with a warning.metadataM2M field fromResourceBaseand drops theExtraMetadatamodel.Code removal
base/models.py: RemovedExtraMetadatamodel andResourceBase.metadataM2M field.base/api/serializers.py: RemovedExtraMetadataSerializerandmetadatadeferred field fromResourceBaseSerializer.base/api/views.py: Removedextra_metadataREST action (GET/PUT/POST/DELETE on/{pk}/extra_metadata/).base/utils.py: Removedvalidate_extra_metadata()and itsschema/settingsimports.resource/utils.py/resource/manager.py: Removedextra_metadataparameter fromupdate_resource()andResourceManager.update().api/resourcebase_api.py: Removedmetadata__*query param filtering from the legacy Tastypie API.settings.py: RemovedDEFAULT_EXTRA_METADATA_SCHEMA,CUSTOM_METADATA_SCHEMA,EXTRA_METADATA_SCHEMA, andfrom schema import Optional.Tests
Removed
TestExtraMetadataBaseApiand alltest_extra_metadata_included_with_param/test_metadata_filterstests that covered the now-deleted functionality.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.