Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'list' object has no attribute 'name' #41

Closed
sanatwagh opened this issue Jul 2, 2020 · 6 comments
Closed

'list' object has no attribute 'name' #41

sanatwagh opened this issue Jul 2, 2020 · 6 comments

Comments

@sanatwagh
Copy link

After changing renderer=None in fields.py, form is visible but wen we submit form it says 'list' object has no attribute 'name'

@hussu010
Copy link

hussu010 commented Jul 7, 2020

same is true for me :(
has anyone came across the same problem?

@Kiel-Hyre
Copy link

Kiel-Hyre commented Jul 11, 2020

same here

errors logs stop here.

File "/usr/local/lib/python3.6/dist-packages/django/core/validators.py", line 516, in validate_image_file_extension
return FileExtensionValidator(allowed_extensions=get_available_image_extensions())(value)
File "/usr/local/lib/python3.6/dist-packages/django/core/validators.py", line 485, in call
extension = Path(value.name).suffix[1:].lower()

my code

class XForm(forms.Form):
    attachments = MultiImageField(min_num=1, max_num=3, max_file_size=1024*1024*5)

# yes i just test it, and this happened.

@Chive
Copy link
Owner

Chive commented Oct 6, 2021

I'm not able to reproduce this on the supported django versions (2.2/3.1/3.2). Please reopen if it's still an issue!

@Chive Chive closed this as completed Oct 6, 2021
@modbender
Copy link

@Chive The same happens to me, I'm trying to use the form in admin, overriding default generated ModelForm.
I need to override is_valid or full_clean from ModelForm to try and fix this, but there's just too much data in there and I don't know which to change or edit.

Simple example:

@admin.register(ExampleModel)
class ExampleModelAdmin(admin.ModelAdmin):
    form = AttachmentForm

@modbender
Copy link

@sanatwagh Could you please reopen the issue?

@dtwm dtwm mentioned this issue Nov 8, 2021
@DmytroLitvinov
Copy link

DmytroLitvinov commented Mar 16, 2022

Hi @Chive ,
I also have that problem.
Django 3.2, Python 3.8.
I am trying to upload multiple files in the input with MultiImageField.

Here is an example of form:

class SupplierMediaForm(forms.Form):
    files = MultiImageField(
        label=_('Choose images to upload'),
        min_num=1,
        max_num=MAX_IMAGES_NUM,
        max_file_size=1024 * 1024 * MAX_IMAGE_SIZE,
    )

The solution for that problem is provided in that comment.
I am happy to provide #49 to fix that issue. Could you please review it, merge and release it to PyPI?

Also, if you need any help from my side, please let me know. I can manage that repo as a collaborator and can be one of maintainer at PyPI

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

No branches or pull requests

6 participants