mirror of
https://github.com/django/django.git
synced 2025-01-05 07:55:47 +00:00
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:
parent
9ede371c85
commit
3bf29d2184
1
AUTHORS
1
AUTHORS
@ -58,6 +58,7 @@ answer newbie questions, and generally made Django that much better:
|
|||||||
lakin.wecker@gmail.com
|
lakin.wecker@gmail.com
|
||||||
Stuart Langridge <http://www.kryogenix.org/>
|
Stuart Langridge <http://www.kryogenix.org/>
|
||||||
Eugene Lazutkin <http://lazutkin.com/blog/>
|
Eugene Lazutkin <http://lazutkin.com/blog/>
|
||||||
|
limodou
|
||||||
Martin Maney <http://www.chipy.org/Martin_Maney>
|
Martin Maney <http://www.chipy.org/Martin_Maney>
|
||||||
Maniac <http://www.softwaremaniacs.org/>
|
Maniac <http://www.softwaremaniacs.org/>
|
||||||
Manuzhai
|
Manuzhai
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from django import models
|
from django import models
|
||||||
from django.core.xheaders import populate_xheaders
|
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.views.auth.login import redirect_to_login
|
||||||
from django.core.extensions import DjangoContext as Context
|
from django.core.extensions import DjangoContext as Context
|
||||||
from django.core.paginator import ObjectPaginator, InvalidPage
|
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
|
# If data was POSTed, we're trying to create a new object
|
||||||
new_data = request.POST.copy()
|
new_data = request.POST.copy()
|
||||||
|
|
||||||
|
if mod.Klass._meta.has_field_type(meta.FileField):
|
||||||
|
new_data.update(request.FILES)
|
||||||
|
|
||||||
# Check for errors
|
# Check for errors
|
||||||
errors = manipulator.get_validation_errors(new_data)
|
errors = manipulator.get_validation_errors(new_data)
|
||||||
manipulator.do_html2python(new_data)
|
manipulator.do_html2python(new_data)
|
||||||
|
Loading…
Reference in New Issue
Block a user