On Fri, Dec 9, 2011 at 11:49 AM, Florian Apolloner
wrote:
>
>
> On Thursday, December 8, 2011 11:36:53 PM UTC+1, Alex_Gaynor wrote:
>>
>> 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
On Thursday, December 8, 2011 11:36:53 PM UTC+1, Alex_Gaynor wrote:
> 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.
>
Your memory serves you wel
On Thu, Dec 8, 2011 at 5:35 PM, Jacob Kaplan-Moss wrote:
> On Thu, Dec 8, 2011 at 2:07 PM, Martin Chase
> wrote:
> > This shouldn't be backwards incompatible, just implementing the
> > __exit__ and __enter__ methods.
> >
> > Use case:
> >
> > class Obj(models.Model):
> >file_field = models.F
On Thu, Dec 8, 2011 at 2:07 PM, Martin Chase 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(filen
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_fil