title: Getting Request in admin.py
body: <p>I have a model like this: </p>
  
  <pre><code>class Item(models.Model):
      code = models.CharField(max_length=200, unique=True)
      barcode = models.CharField(max_length=300)
      desc = models.CharField('Description',max_length=500)
      display_desc = models.CharField('Description',max_length=500,
                                      blank=True, null=True)
      price = models.FloatField()
      discountable = models.BooleanField(blank=True, default=False)
      image_path = models.CharField(max_length=300,unique=True, blank=True, null=True)    
  
      def __unicode__(self):
          return self.code + ' : ' + self.desc
  </code></pre>
  
  <p>But unfortunately, I don't want to store the item's image in the database, instead I want to store the image path in the server in the <code>image_path</code> column.</p>
  
  <p>So, I created a custom admin.py for this object so that I could edit/insert the object thru the Django admin module. As a result, below is the customized admin.py</p>
  
  <pre><code>class ItemAdminForm(forms.ModelForm):
      file_upload = forms.FileField(required=False)
  
      class Meta:
          model = Item
  
      def __init__(self, *args, **kwargs):
          super(ItemAdminForm, self).__init__(*args,**kwargs)
  
          #if kwargs.has_key('instance'):
          #    instance = kwargs['instance']
          #    self.initial['file_upload'] = instance.file_upload
  
      def handle_uploaded_file(f):
          destination = open('D:/Project/pensel/penselshop/static/picture', 'wb+')
          for chunk in f.chunks():
              destination.write(chunk)
          destination.close()
          return f.name
  
      def save(self,commit=True):
          name = None
          extension = None
          #error here! How could I get the request?
          miniform = ItemAdminForm(request.POST, request.FILES)
          if miniform.is_valid():
              name = handle_uploaded_file(request.FILES['file_upload'])    
              extension = name.split('.')[1]
          model = super(ItemAdminForm, self).save(commit=False)
          model.image_path = '/static/picture/' + model.code + extension        
  
          if commit:
              model.save()
  
          return model
  </code></pre>
  
  <p>However, during processing the <code>save()</code> function, I noticed that there is an error in getting the request. How can I get the request so that I could retrieve the file? I noticed that the request is automatically added in views.py, but not admin.py</p>