#8765: mod_python handler requires explicit str() cast for
HttpResponse(mimetype=...)
------------------------------------+---------------------------------------
          Reporter:  semenov        |         Owner:  nobody                    
      
            Status:  new            |     Milestone:                            
      
         Component:  HTTP handling  |       Version:  SVN                       
      
        Resolution:                 |      Keywords:  mod_python content-type 
mimetype
             Stage:  Unreviewed     |     Has_patch:  1                         
      
        Needs_docs:  0              |   Needs_tests:  0                         
      
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Comment (by semenov):

 Also, if you're still curious, that is how Model instances are created
 (i.e., how are unicode content_types originally created):

 {{{
 #!python
 class Comment:

         # ...

         def create_attachments(self, uploaded_files):
                 for uploaded_file in uploaded_files:
                         a = self.attachment_set.create(
                                 filename = uploaded_file.name,
                                 content_type = uploaded_file.content_type,
                                 content_length = uploaded_file.size,
                         )
                         a.file.save('%s' % a.id, uploaded_file)

 # ....

 comment.create_attachments(request.FILES.getlist('attachment'))
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8765#comment:3>
Django Code <http://code.djangoproject.com/>
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 [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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to