#9894: Give the FileField 'upload_to' callable access to an UploadedFile's contents. -----------------------------------------+---------------------------------- Reporter: Pyth | Owner: nobody Status: new | Milestone: post-1.0 Component: File uploads/storage | Version: 1.0 Keywords: feature upload_to FileField | Stage: Unreviewed Has_patch: 0 | -----------------------------------------+---------------------------------- `FileField.upload_to` allows for a callable and requests an `instance` and a `filename`. Because it may be of interest to the programmer to use the file's content (MD5 sum, MIME type, ID3 tags etc.) in the upload path, it would be handy to be able to access it from the callable method.
One possibility would be to pass an `UploadedFile` instead of a `filename` but this would break the compatibility policy in 1.0.X. Temporarily, this functionality could be added via an `uploaded_file` or `content` property added to the instance (in `FieldFile.save()`), making it accessible from the `upload_to(instance, filename)` callable with `instance.uploaded_file`. I'll throw up some patches if this makes any sense. -- Ticket URL: <http://code.djangoproject.com/ticket/9894> Django <http://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 post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
