1

How do I add fields in the metadata of gridfs along with the default fields? Using the following code in models.py

class Event(models.Model):
    name = models.CharField(max_length=10*1024*1024)
    details = models.TextField()
    image = models.FileField(storage=gridfs, upload_to='/uploads')

It gives only the default fields in the metadata of gridfs

> db.storage.uploads.files.findOne()
{
    "_id" : ObjectId("54e5e7b48cdc060e7e395a20"),
    "chunkSize" : 261120,
    "filename" : "programmingquotes.jpg",
    "length" : 25907,
    "uploadDate" : ISODate("2015-02-19T13:40:04.685Z"),
    "md5" : "34c9e80e9a87b632e24b30d29c19e32e"
}

How do I add extra fields in this metadata?

kaushikdr
  • 1,699
  • 2
  • 12
  • 18

0 Answers0