dvshnt / django-photologue

Automatically exported from code.google.com/p/django-photologue
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add Photo template rejects all path values #145

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Problem: I can add a Photo object using the admin interface but not using
my addscreen method. Using the template always yields a "This field is
required." error for the image field.

## django-photologue version is current svn trunk

## django version is 1.1.1-1ubuntu1

========================

====== views.py ========

========================

@login_required

def addscreen(request, object_id):

    if request.method == 'POST': 

        form = PhotoForm(request.POST) 

        if form.is_valid(): 

            return render_to_response('mapshare_core/uploadresult.html',
context_instance=RequestContext(request))

    else:

        form = PhotoForm()

    return render_to_response('mapshare_core/addphoto.html', {

        'form': form, 'id' : object_id

    })

=================================

======== addphoto.html ==========

=================================

<form action="/map/{{id}}/addscreen" method="post">

<!--{{ form.image }}-->

{{ form.as_p }}

    <input type="submit" value="Upload" />

</form>

Original issue reported on code.google.com by blubbi4...@googlemail.com on 7 Dec 2009 at 9:54