#25756: ArrayField does not work with FileField
----------------------------------+-----------------
     Reporter:  adongy            |      Owner:
         Type:  Bug               |     Status:  new
    Component:  contrib.postgres  |    Version:  1.8
     Severity:  Normal            |   Keywords:
 Triage Stage:  Unreviewed        |  Has patch:  0
Easy pickings:  0                 |      UI/UX:  0
----------------------------------+-----------------
 When using the following models.py definition :
 {{{
 from django.contrib.postgres.fields import ArrayField

 class Album(models.Model):
     pictures = ArrayField(models.FileField(upload_to='files'))
 }}}

 And the following admin.py
 {{{
 from django.contrib.postgres.forms import SplitArrayField
 class AlbumForm(forms.ModelForm):
     pictures = SplitArrayField(forms.FileField(), size=2)
     class Meta:
         model = models.Album
         fields = '__all__'

 class AlbumAdmin(admin.ModelAdmin):
     form = AlbumForm

 admin.site.register(models.Album, AlbumAdmin)
 }}}

 Creating a new Album in the Django admin works, but:

 - Files are not getting saved
 - Retrieving a FieldFile is impossible:
 {{{
 python manage.py shell
 from my_app.models import Album
 Album.objects.get().pictures == [u'filename.png', u'filename2.png']
 }}}

 I would have expected a list of FieldFiles.

--
Ticket URL: <https://code.djangoproject.com/ticket/25756>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.a7924bb4abba864ff55049a42485eef1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to