Closed evgkirov closed 9 months ago
Yeah, it sounds like a bug. When "multiple" is disabled, we shouldn't append [] to the input name. I'll fix it tomorrow.
Just to clarify, under "singular uploads" you mean exactly when "multiple" is false, right?
multiple
is false
or not set.
multiple
isfalse
or not set.
but multiple is enabled by default
My bad. I shall re-check.
It does add []
even though multiple="false"
is set.
Fixed in https://github.com/uploadcare/blocks/releases/tag/v0.32.2, check it please
Is your feature request related to a problem? Please describe.
When updating Blocks in pyuploadcare from version 0.30.7 to 0.32.1, I encountered an issue with singular file uploaders. Previously, I used
<lr-data-output>
to create a singular<input>
withname="logo"
, which aligns with Django's expectations.However, with Blocks v0.32.x transitioning to
<lr-form-input>
, the<input>
names now include a[]
suffix, as described in the documentation. While I understand the benefits of this approach, it doesn't align with Django's expectation oflogo
without the[]
suffix for singular uploads.Describe the solution you'd like
I propose adding a new setting within
<lr-config>
that allows disabling the array-style input names for singular uploads. This would provide users with more control over the naming convention, allowing compatibility with frameworks like Django.