Deprecate the Record.contents property #1114
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR issues
DeprecationWarnings
if the Record.contents (or Attachment.contents) property is accessed. It also deprecates the use of the FileContents class.The
Page.contents
andAttachment.contents
properties returnFileContents
instances. These purport to provide a way to read the contents of the source files for the (metadata) of pages and attachments, as well as various checksums, etc. Since the initial comment in the current repo, none of the above have ever been used in Lektor's code.When alts are in use, the properties are broken. When alts are in use, the metadata for each record comes from (potentially) multiple
.lr
files. Since there is no single file whose contents should be returned, it's not at all clear what the semantics of the.contents
property should be in this case. See #1026 for more on this.Issue(s) Resolved
Declares #1026 a "won't fix".
Related Issues / Links
This PR depends on (and is stacked on) PR #1113.
See #1026
Discussion/Alternatives
Just delete these instead of deprecating first?