Skip to content

Conversation

bluetech
Copy link
Contributor

@bluetech bluetech commented May 2, 2023

…storage=...)

The migrations serializer can't handle lambdas.
@bluetech bluetech force-pushed the rm-filefield-storage-lambda branch from 95b59ae to ce71817 Compare May 2, 2023 11:46

In order to set a storage defined in the :setting:`STORAGES` setting you can
use a lambda function::
use :data:`~django.core.files.storage.storages`::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nessita nessita changed the title Fixed #34530 - Removed suggestion to use lambda for models.FileField(storage=...) Fixed #34530 - Removed suggestion to use lambda for models.FileField(storage=...). May 2, 2023
@nessita nessita changed the title Fixed #34530 - Removed suggestion to use lambda for models.FileField(storage=...). Fixed #34530 -- Improved docs when customizing storage for FileField. May 2, 2023
Copy link
Contributor

@nessita nessita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change!

@nessita nessita merged commit 506f93f into django:main May 2, 2023
@timgraham
Copy link
Member

In the future, I'd suggest using a more descriptive commit message along the lines of the original (perhaps "Used a callable rather than a lambda in FileField storage example.") rather than a vague "Improved docs". Cheers!

@nessita
Copy link
Contributor

nessita commented May 3, 2023

Thanks @timgraham, I appreciate the nudge. I'm struggling with balancing good commit messages that ideally fit within 72 characters. I know we can make exceptions if it's really worth it; it's just that the criteria is so subjective that I'm still learning where to draw the line.

On a second thought, I could've added a paragraph below the summary with a longer explanation.

@timgraham
Copy link
Member

I never really worried about commit message length. Typically, I'd prefer a longer length to a separate paragraph of explanation, because in most cases, it's fairly easy to look up the ticket to understand the issue a bit more. I think a one-line descriptive commit message gives the most useful git log. My 2 cents.

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.

4 participants