Fixed #816 -- FileFields now work in the create_update generic view. Thanks, limodou

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-12-01 06:36:47 +00:00
parent 9ede371c85
commit 3bf29d2184
2 changed files with 31 additions and 27 deletions

View File

@ -58,6 +58,7 @@ answer newbie questions, and generally made Django that much better:
lakin.wecker@gmail.com
Stuart Langridge <http://www.kryogenix.org/>
Eugene Lazutkin <http://lazutkin.com/blog/>
limodou
Martin Maney <http://www.chipy.org/Martin_Maney>
Maniac <http://www.softwaremaniacs.org/>
Manuzhai

View File

@ -1,6 +1,6 @@
from django import models
from django.core.xheaders import populate_xheaders
from django.core import template_loader, formfields
from django.core import template_loader, formfields, meta
from django.views.auth.login import redirect_to_login
from django.core.extensions import DjangoContext as Context
from django.core.paginator import ObjectPaginator, InvalidPage
@ -27,6 +27,9 @@ def create_object(request, app_label, module_name, template_name=None,
# If data was POSTed, we're trying to create a new object
new_data = request.POST.copy()
if mod.Klass._meta.has_field_type(meta.FileField):
new_data.update(request.FILES)
# Check for errors
errors = manipulator.get_validation_errors(new_data)
manipulator.do_html2python(new_data)