Ticket #816: create_update.py.diff

File create_update.py.diff, 862 bytes (added by limodou, 19 years ago)

patch file

  • create_update.py

    old new  
    11from django import models
    22from django.core.xheaders import populate_xheaders
    3 from django.core import template_loader, formfields
     3from django.core import template_loader, formfields, meta
    44from django.views.auth.login import redirect_to_login
    55from django.core.extensions import DjangoContext as Context
    66from django.core.paginator import ObjectPaginator, InvalidPage
     
    2626    if request.POST:
    2727        # If data was POSTed, we're trying to create a new object
    2828        new_data = request.POST.copy()
     29
     30        opts = mod.Klass._meta
     31        if opts.has_field_type(meta.FileField):
     32            new_data.update(request.FILES)
    2933       
    3034        # Check for errors
    3135        errors = manipulator.get_validation_errors(new_data)
Back to Top