{{{
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.
* stage: Unreviewed => Accepted
Comment:
Hi bluetech!
Thanks for identifying this 👍 Interested in submitting a PR?
--
Ticket URL: <https://code.djangoproject.com/ticket/34530#comment:1>
Comment (by David Sanders):
> So I think this paragraph should just be removed (the previous paragraph
is good enough, using a named function).
Personally I think an example involving `storages` is worth keeping though
🤷♂️
> 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.
Seems like something worth raising on the forum.
--
Ticket URL: <https://code.djangoproject.com/ticket/34530#comment:2>
* easy: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/34530#comment:3>
Comment (by Ran Benita):
Thanks David, agreed about keeping an example using `storages`. I sent a
PR.
> Seems like something worth raising on the forum.
If I have some time I'll try checking if it makes sense first :)
--
Ticket URL: <https://code.djangoproject.com/ticket/34530#comment:4>