#34530: Remove docs suggestion to use lambda for models.FileField(storages=...)
-----------------------------------------+------------------------
               Reporter:  Ran Benita     |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  new
              Component:  Documentation  |        Version:  4.2
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 The file storage docs
 https://docs.djangoproject.com/en/4.2/topics/files/#using-a-callable
 currently suggest the following:

 {{{
 upload = models.FileField(storage=lambda: storages["custom_storage"])
 }}}

 The migrations serializer however doesn't handle lambdas. So I think this
 paragraph should just be removed (the previous paragraph is good enough,
 using a named function).

 Side note: it might have been nice to allow `FileField(storage="foo")`
 which will lazily take `storages["foo"]` and thus avoid the callable
 annoyance? But that's unrelated to this ticket.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34530>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187dc3835fc-eae3b846-717b-453e-a774-4f9e8ee744af-000000%40eu-central-1.amazonses.com.

Reply via email to