On Thu, Dec 8, 2011 at 5:35 PM, Jacob Kaplan-Moss <[email protected]>wrote:
> On Thu, Dec 8, 2011 at 2:07 PM, Martin Chase <[email protected]> > wrote: > > This shouldn't be backwards incompatible, just implementing the > > __exit__ and __enter__ methods. > > > > Use case: > > > > class Obj(models.Model): > > file_field = models.FileField(upload_to="test") > > ... > > obj = Obj() > > obj.file_field.save(filename, content) > > ... > > with obj.file_field.open() as a_file: > > a_file.read() > > > > Any reason I shouldn't make a ticket and patch for this? > > Sounds like a good idea to me - go ahead! > > Jacob > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" 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-developers?hl=en. > > It isn't alreayd?!?! All file objects django exposes should be context managers, I thought I added that to a base mixin class a while ago, but apparently I didn't add it to the right thing. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire) "The people's good is the highest law." -- Cicero -- You received this message because you are subscribed to the Google Groups "Django developers" 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-developers?hl=en.
