To save strings/bytes you need to use ContentFile up to now:
path = default_storage.save('path/to/file', ContentFile(b'new content'))
Docs: https://docs.djangoproject.com/en/3.1/topics/files/#storage-objects
Things would be bit easier, if save() would support strings/bytes directly.
This way
I'll also chime in to say I'd be against expanding these shortcut
parameters. They muddy the purpose of the View class for a small saving in
LoC, and go against "TOOWTDI".
On Wed, 17 Feb 2021 at 15:07, Tim Graham wrote:
> This has been proposed before (closed as wontfix):
> https://code.djangopr
This has been proposed before (closed as wontfix):
https://code.djangoproject.com/ticket/24589
https://groups.google.com/g/django-developers/c/34HJqx48h6Y/m/Nm3UMTK4BgAJ
On Wednesday, February 17, 2021 at 9:53:07 AM UTC-5 jonask...@gmail.com
wrote:
>
> # Feature request: wigets attribute for Mod
# Feature request: wigets attribute for ModelFormMixin class
### Status quo
The `ModelFormMixin` class currently implements the `fields` attribute by
it self and pass it to the `modelform_factory`:
```python
class ModelFormMixin(FormMixin, SingleObjectMixin):
"""Provide a way to show and h