Skip to main content
# django-file-resubmit

In Django project you have forms with FileField, ImageField. Everything works great, but
when ValidationError is raised, you have to reselect all files and images again. It is
kind of annoying. **django-file-resubmit** solves this problem.
It works with FileField, ImageField and sorl.thumbnail.ImageField.

The original idea was developed by team of https://github.com/generalov/django-resubmit.
django-file-resubmit was started to avoid some restrictions of django-resubmit, such as
supporting last version of sorl-thumbnail, simplify configuration and integration with a project.

## How does it work?

Here are advanced widgets for FileField and ImageField. When you submit files, every widget
saves its file in cache. And when ValidationError is raised, widgets restore files from cache.


# Requirements

- sorl-thumbnail, http://thumbnail.sorl.net/

# Installation

$ pip install django-file-resubmit


# Configuration

Add `"file_resubmit"` to `INSTALLED_APPS`.

INSTALLED_APPS = {
...
'sorl.thumbnail',
'file_resubmit',
...
}

Setup cache in settings.py.

CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
},
"file_resubmit": {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
"LOCATION": project_path('data/cache/file_resubmit')
},
}

# Examples

## Admin example

from django.contrib import admin
from file_resubmit.admin import AdminResubmitMixin

class ModelAdmin(AdminResubmitMixin, ModelAdmin):
pass

## Widgets examples

from django.forms import ModelForm
from file_resubmit.admin import AdminResubmitImageWidget, AdminResubmitFileWidget

class MyModelForm(forms.ModelForm)

class Meta:
model = MyModel
widgets = {
'picture': AdminResubmitImageWidget,
'file': AdminResubmitFileWidget,
}

# Licensing

django-file-resubmit is free software under terms of the MIT License.


**Copyright (C) 2011 by Ilya Shalyapin**, ishalyapin@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Release files for django-file-resubmit 0.3.666666

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-file-resubmit 0.3.666666
File Size Uploaded
django-file-resubmit-0.3.666666.tar.gz 4.4 kB Details

Release files / django-file-resubmit-0.3.666666.tar.gz

Download URL django-file-resubmit-0.3.666666.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a9be193f932c368165cc6fd9a2c1a1484faaca9390e9db6c80aa06515fe2559e
BLAKE2b-256 checksum
How to use checksums
9598d2ad282e9e954e0bac0c8779ce64a1125121c12fda15fd86a8eaa616abdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4

1 release file

This release

0.3.666666 This release

1 release file

0.3.333

1 release file

0.3.7

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page