Skip to main content

Cache Files in Form for files retaining

Project description

Django Form File Field cache

Quick start

  1. Add filefield_cache INSTALLED_APPS settings:

    .. code-block:: python

     INSTALLED_APPS = (
         ...
    
         'filefield_cache',
         ...
     )
    
  2. Add Admin form in admin.py .. code-block:: python

     from django.contrib import admin
     from django.contrib.admin import register
    
     from demo.documents.forms import DocumentForm
     from demo.documents.models import Document
    
    
     @register(Document)
     class DocumentAdmin(admin.ModelAdmin):
         form = DocumentForm
         ...
    
  3. Create form in forms.py. .. code-block:: python

     from django import forms
    
     from filefield_cache.widgets import CachedAdminFileWidget
     from demo.documents.models import Document
    
    
     class DocumentForm(forms.ModelForm):
         file = forms.FileField(widget=CachedAdminFileWidget)
         picture = forms.ImageField(widget=CachedAdminFileWidget)
    
         class Meta:
             model = Document
             fields = '__all__'
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for filefield-cache, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size filefield_cache-0.0.5-py3-none-any.whl (4.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size filefield-cache-0.0.5.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page