Insert multiple images in the same register in GridFS

10 views
Skip to first unread message

Hélio Miranda

unread,
May 15, 2013, 6:00:06 AM5/15/13
to django...@googlegroups.com
Hi

In my Django application and I am mongodb insert photos in GridFS from mongo.
Enter only one photo in a record, everything ok.

Now when I want to enter more than one, I'm not getting. I'm set as a list, but it gives error.
I'm doing this test to start:

Painting class (Document):
     Stringfield artist = ()
     photo = ListField (FileField ())

my_painting = Painting (artist = 'Steve')
my_painting.photo = open ('C :/ BD.JPG', 'r')
my_painting.save ()

But it gives me the following error: ValidationError (Only lists and tuples may be used in the field list: ['photo'])
Yes, I realize that I can only insert lists or tuples in a field list field ... but I do not understand how to do it?
Someone can help me?
Reply all
Reply to author
Forward
0 new messages