#4165: Upload Progress Middleware and Integration into the Admin
---------------------------------------------+------------------------------
   Reporter:  Michael Axiak <[EMAIL PROTECTED]>  |                Owner:  
adrian         
     Status:  new                            |            Component:  Admin 
interface
    Version:  SVN                            |           Resolution:            
     
   Keywords:  upload, progress               |                Stage:  
Unreviewed     
  Has_patch:  1                              |           Needs_docs:  1         
     
Needs_tests:  1                              |   Needs_better_patch:  1         
     
---------------------------------------------+------------------------------
Comment (by Michael Axiak <[EMAIL PROTECTED]>):

 Alright, I've cleaned up ideas from #2070 and reformulated to this patch
 (the !JavaScript is left unchanged).
 Here's how you can use it:
 
 1. '''Add the patch from #2070''' (e.g. 5100_file_upload_core.diff:
 {{{
 patch -p0 < 5100_file_upload_core.diff
 }}}
 
 2. Add this patch (same as above)
 
 3. Create the model:
 {{{
 #!python
 from django.db import models
 
 # Create your models here.
 class FileList(models.Model):
     name = models.CharField(maxlength=255)
     email = models.EmailField()
 
     class Admin:
         js = ('/admin/media/js/UploadProgress.js',)
 
 class AFile(models.Model):
     descr = models.CharField(maxlength=255,core=True)
     file = models.FileField(upload_to='files')
     inlist = models.ForeignKey(FileList,edit_inline=models.STACKED)
 }}}
 
 4. Add {{{django.middleware.upload.UploadStateMiddleware}}} to your
 {{{MIDDLEWARE_CLASSES}}} setting (at the beginning, possibly)
 
 5. Set {{{FILE_UPLOAD_DIR}}} in your settings file to wherever you want to
 store temporary files.
 
 6. Enjoy :)
 
 '''TODO:'''
 
 * Test
 
 * Write tests/docs
 
 * Write widget for newforms (that generates uuid)

-- 
Ticket URL: <http://code.djangoproject.com/ticket/4165#comment:4>
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