Re: FileField and ImageField

2016-03-20 Thread Cristiano Coelho
I have done some work here https://github.com/cristianocca/django/commit/4be936ba3031f95d34101a919648f4e8f7d7856a And opened a ticket here https://code.djangoproject.com/ticket/26382 If someone's willing to take a look. -- You received this message because you are subscribed to the Google Groups

Re: FileField and ImageField

2016-03-20 Thread Cristiano Coelho
I agree with you, generate_filename should just call the field upload_to and then delegate the whole name generation to the storage. There's another thing about file storage that is troubling me: https://github.com/django/django/blob/master/django/core/files/storage.py#L57 The docs state you ar

Re: FileField and ImageField

2016-03-19 Thread Josh Smeaton
It seems like FileField should delegate some of these methods to an underlying Storage backend, no? I don't know what the implications to back-compat would be, but the idea seems like a sensible one to start with. The storage backend API may need to grow some additional methods to verify/valida

Re: FileField and ImageField

2016-03-19 Thread Cristiano Coelho
To add a bit more about this, it seems that FileField is really meant to be working with an OS file system, making it harder to use a custom Storage that sends data to somewhere like AWS S3 where basically everything is a file (there are no real folders, just key prefixes) These 3 functions ins

FileField and ImageField

2016-03-19 Thread Cristiano Coelho
I am recently trying to make an aws S3 storage (I know there are a few libraries in there but I needed some customization). The storage works fine so far! However, there are some implementation details on FileField and ImageField, in particular the function generate_filename https

Re: FileField and ImageField

2016-03-18 Thread Josh Smeaton
It seems like you have a pretty good grasp on the problems and possible solutions. I'm not familiar enough with storage backends and FileFields to provide much guidance so hopefully someone else can comment. Regarding the linked line in the save method which forces forward slashes, it seems that

Re: Document direct API usage of FileField and ImageField

2010-09-17 Thread Owen Nelson
Actually, I'm not sure what way to go with this. All the info is there, it's just spread around in a number of topics: http://docs.djangoproject.com/en/dev/ref/files/file/ http://docs.djangoproject.com/en/dev/topics/http/file-uploads/

Re: Document direct API usage of FileField and ImageField

2010-09-17 Thread Owen Nelson
I'd love to pitch in on updating the docs for file handling :) Even though this kind of talk is better suited over on django-users, here's one way to skin a cat. I had a view that displayed a model form (one of the fields was a FileField). I needed to alter the resolution of the uploaded image t

Re: Document direct API usage of FileField and ImageField

2010-09-15 Thread Yo-Yo Ma
On Sep 15, 5:52 pm, Russell Keith-Magee wrote: > On Thu, Sep 16, 2010 at 2:28 AM, Yo-Yo Ma wrote: > > I think it might be a good idea to document the direct usage of the > > FileField, and ImageField model fields. > > Sure -- sounds like a reasonable proposal to me. Open a t

Re: Document direct API usage of FileField and ImageField

2010-09-15 Thread Russell Keith-Magee
On Thu, Sep 16, 2010 at 2:28 AM, Yo-Yo Ma wrote: > I think it might be a good idea to document the direct usage of the > FileField, and ImageField model fields. Sure -- sounds like a reasonable proposal to me. Open a ticket on Trac so the idea isn't forgotten. We also accept patches

Re: Document direct API usage of FileField and ImageField

2010-09-15 Thread Yo-Yo Ma
BTW, ignore the PIL imports On Sep 15, 12:28 pm, Yo-Yo Ma wrote: > I think it might be a good idea to document the direct usage of the > FileField, and ImageField model fields. > > The docs make the assumption that everyone is using ModelForm to > upload files. If I have a file o

Document direct API usage of FileField and ImageField

2010-09-15 Thread Yo-Yo Ma
I think it might be a good idea to document the direct usage of the FileField, and ImageField model fields. The docs make the assumption that everyone is using ModelForm to upload files. If I have a file on my hard drive and want to use it to populate the field, I would try something like

Re: Ability to delete contents of FileField and ImageField in admin

2008-08-18 Thread David Reynolds
On 18 Aug 2008, at 2:56 pm, Brian Rosner wrote: > Keep an eye on http://code.djangoproject.com/ticket/7048. Thanks, Brian. -- David Reynolds [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: Ability to delete contents of FileField and ImageField in admin

2008-08-18 Thread Brian Rosner
On Mon, Aug 18, 2008 at 7:30 AM, David Reynolds <[EMAIL PROTECTED]> wrote: > I notice some discussion about this from a while back but as far as I > can tell it has all gone quiet. This may be because it has been > fixed, or possibly because it has been forgotten about. Can anyone > give me a stat

Ability to delete contents of FileField and ImageField in admin

2008-08-18 Thread David Reynolds
Hi, I notice some discussion about this from a while back but as far as I can tell it has all gone quiet. This may be because it has been fixed, or possibly because it has been forgotten about. Can anyone give me a status update of whether or not it is possible to delete the contents of a

Re: #3297newforms: Implement FileField and ImageField

2007-02-22 Thread [EMAIL PROTECTED]
Added more tests now, seems to work fine. On 21 Feb, 11:00, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > You use the latest patch? > > Still needs tests for required/not required/failed required/empty file/ > wrong encoding of form/valid image/invalid image for create and > update. > > On 21

Re: #3297newforms: Implement FileField and ImageField

2007-02-21 Thread [EMAIL PROTECTED]
You use the latest patch? Still needs tests for required/not required/failed required/empty file/ wrong encoding of form/valid image/invalid image for create and update. On 21 Feb, 01:36, Sandro Dentella <[EMAIL PROTECTED]> wrote: > On Tue, Feb 20, 2007 at 06:14:34PM -, [EMAIL PROTECTED] wro

Re: #3297newforms: Implement FileField and ImageField

2007-02-20 Thread Sandro Dentella
On Tue, Feb 20, 2007 at 06:14:34PM -, [EMAIL PROTECTED] wrote: > > Could someone review this ticket? I started using it last week. I /really, really/ needed it and it seems to work fine in a version of create_update working with newforms, so that I use it both with form_for_model and form_fo

#3297newforms: Implement FileField and ImageField

2007-02-20 Thread [EMAIL PROTECTED]
Could someone review this ticket? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, se

Re: proposal and patch: original_filename with FileField and ImageField

2006-12-08 Thread tsuyuki makoto
Ok, I just added a ticket(http://code.djangoproject.com/ticket/3119). Forget this patch at this time. Do you have any idea? 2006/12/4, tsuyuki makoto <[EMAIL PROTECTED]>: > Hello django developers. > > Currently, FIleField and ImageField store file-system-safe file name. >

proposal and patch: original_filename with FileField and ImageField

2006-12-04 Thread tsuyuki makoto
Hello django developers. Currently, FIleField and ImageField store file-system-safe file name. Imagine, if user upload a file named é.txt. Yes, File-system-safe file name is .txt or _.txt. It's not special case in Japan. I know Django says non dynamic contents should be served via apach