Re: [Django] #8501: It is not possible to save file opened by urllib2.urlopen

2008-10-02 Thread Django
#8501: It is not possible to save file opened by urllib2.urlopen
---+
  Reporter:  [EMAIL PROTECTED]  | Owner:  anonymous   
Status:  new   | Milestone:  post-1.0
 Component:  File uploads/storage  |   Version:  SVN 
Resolution:|  Keywords:  urllib, file
 Stage:  Unreviewed| Has_patch:  1   
Needs_docs:  1 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Comment (by SmileyChris):

 Interesting. It seems this is more useful than just for urlopen - it
 allows saving file objects (and stringio streams) directly too. In fact,
 I'd write urlopen off as a side-effect and rejigg the patch tests to just
 use `open()`

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #8501: It is not possible to save file opened by urllib2.urlopen

2008-09-17 Thread Django
#8501: It is not possible to save file opened by urllib2.urlopen
---+
  Reporter:  [EMAIL PROTECTED]  | Owner:  anonymous   
Status:  new   | Milestone:  post-1.0
 Component:  File uploads/storage  |   Version:  SVN 
Resolution:|  Keywords:  urllib, file
 Stage:  Unreviewed| Has_patch:  1   
Needs_docs:  1 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Changes (by daonb <[EMAIL PROTECTED]>):

  * status:  assigned => new
  * needs_docs:  0 => 1
  * has_patch:  0 => 1

Comment:

 Patch 8501v1.diff supports passing the result of a urlopen as the content
 parameter for the save method of FileField and ImageField. Here's the
 included testing code:
 {{{
 >>> obj5 = Storage()
 >>> image_data_len =
 
len(urlopen('http://media.djangoproject.com/img/badges/djangosite80x15.gif').read())
 >>>
 
obj5.image.save('django_logo.gif',urlopen('http://media.djangoproject.com/img/badges/djangosite80x15.gif'))
 >>> obj5.image
 
 >>> image_data_len == obj5.image.size
 True
 >>> obj5.image.width
 80L
 >>> obj5.image.height
 15L
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #8501: It is not possible to save file opened by urllib2.urlopen

2008-09-16 Thread Django
#8501: It is not possible to save file opened by urllib2.urlopen
---+
  Reporter:  [EMAIL PROTECTED]  | Owner:  anonymous   
Status:  assigned  | Milestone:  post-1.0
 Component:  File uploads/storage  |   Version:  SVN 
Resolution:|  Keywords:  urllib, file
 Stage:  Unreviewed| Has_patch:  0   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Changes (by daonb <[EMAIL PROTECTED]>):

  * status:  new => assigned
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * milestone:  => post-1.0
  * owner:  nobody => anonymous
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---