Re: reason for missing readline() in uploaded files?

2009-02-03 Thread Julien Phalip
On Feb 4, 3:12 am, Marty Alchin wrote: > I suppose I should probably weigh in over here. For those who don't > know, I worked on much of Django's file handling, refactoring > FileField, adding storage options and standardizing the File interface > across models, forms,

Re: reason for missing readline() in uploaded files?

2009-02-03 Thread Ivan Sagalaev
Marty Alchin wrote: > I'm not opposed to adding readline(). It's part of the standard file > protocol BTW, it's required by PIL when it reads file objects. So it's useful in practice, not only for completeness. --~--~-~--~~~---~--~~ You received this message

Re: reason for missing readline() in uploaded files?

2009-02-03 Thread Marty Alchin
I suppose I should probably weigh in over here. For those who don't know, I worked on much of Django's file handling, refactoring FileField, adding storage options and standardizing the File interface across models, forms, storage and uploads. If there are methods missing, I'm almost certainly

Re: reason for missing readline() in uploaded files?

2009-02-03 Thread Ales Zoulek
I'd prefer explicit mapping in a way: for methodname in ('seek', 'tell', 'readline'): # Map methodname File.file. to django's File. 1] You easy way to control mapping 2] You don't repeat yourself 3] Explicit and readable system 4] You avoid you're "queasy feeling" BTW: What if python file

Re: reason for missing readline() in uploaded files?

2009-01-30 Thread Todd O'Bryan
On Fri, Jan 30, 2009 at 5:08 PM, Ludvig Ericson wrote: > > On Jan 30, 2009, at 22:19, Todd O'Bryan wrote: >> >> I'm not sure I understand this. If you try to call a file-like method >> or access a file-like attribute on an UploadedFile, it would either do >> the right

Re: reason for missing readline() in uploaded files?

2009-01-30 Thread Ludvig Ericson
On Jan 30, 2009, at 22:19, Todd O'Bryan wrote: > On Fri, Jan 30, 2009 at 3:10 PM, Ludvig Ericson > wrote: >> >> On Jan 30, 2009, at 17:28, Todd O'Bryan wrote: >>> OK, after I did this, I was lying in bed and had the following >>> revelation. Would there be anything

Re: reason for missing readline() in uploaded files?

2009-01-30 Thread Todd O'Bryan
On Fri, Jan 30, 2009 at 3:10 PM, Ludvig Ericson wrote: > > On Jan 30, 2009, at 17:28, Todd O'Bryan wrote: >> OK, after I did this, I was lying in bed and had the following >> revelation. Would there be anything terribly wrong with just using >> __getattr__ in

Re: reason for missing readline() in uploaded files?

2009-01-30 Thread Ludvig Ericson
On Jan 30, 2009, at 17:28, Todd O'Bryan wrote: > OK, after I did this, I was lying in bed and had the following > revelation. Would there be anything terribly wrong with just using > __getattr__ in UploadedFile to forward all attribute requests that the > UploadedFile can't process to self._file,

Re: reason for missing readline() in uploaded files?

2009-01-30 Thread Todd O'Bryan
On Thu, Jan 29, 2009 at 11:14 PM, Todd O'Bryan wrote: > On Thu, Jan 29, 2009 at 9:28 PM, Malcolm Tredinnick > wrote: >> >> On Thu, 2009-01-29 at 15:40 -0500, Todd O'Bryan wrote: >>> I'm trying to validate an uploaded csv file, so I want to read