On Thu, Dec 8, 2011 at 5:35 PM, Jacob Kaplan-Moss <ja...@jacobian.org>wrote:
> On Thu, Dec 8, 2011 at 2:07 PM, Martin Chase <outofcult...@gmail.com> > 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 django-developers@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscr...@googlegroups.com. > 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 django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.