Skip to content

feat!: Collection.key -> Collection.collection_code#504

Draft
kdmccormick wants to merge 1 commit intomainfrom
kdmccormick/collection-code
Draft

feat!: Collection.key -> Collection.collection_code#504
kdmccormick wants to merge 1 commit intomainfrom
kdmccormick/collection-code

Conversation

@kdmccormick
Copy link
Member

@kdmccormick kdmccormick commented Mar 18, 2026

Also, standardize internal usage of collection_key to collection_code. This helps clarify that Collection.key is not an OpaqueKey, but is rather a local slug, which can be combined with other identifiers to form a fully- qualified LibraryCollectionKey instance.

BREAKING CHANGE: Collection.key has been renamed to Collection.collection_code. The underlying database field is still named _key.

BREAKING CHANGE: Collection.get_by_key is now Collection.get_by_code

BREAKING CHANGE: Collection.collection_code now validates that its contents is a valid 'Slug' [A-Za-z0-9_-]. This was already effectively true, because LibraryCollectionKey can only be built with slug-like parts, but we now enforce it at the db level.

Part of: #322

Also, standardize internal usage of collection_key to collection_code.
This helps clarify that Collection.key is *not* an OpaqueKey, but is rather
a local slug, which can be combined with other identifiers to form a fully-
qualified LibraryCollectionKey instance.

BREAKING CHANGE: Collection.key has been renamed to Collection.collection_code.
The underlying database field is still named _key.

BREAKING CHANGE: Collection.collection_code now validates that its contents
is a valid 'Slug' [A-Za-z0-9_-]. This was already effectively true, because
LibraryCollectionKey can only be built with slug-like parts, but we now
enforce it at the db level.

Part of: #322
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant