Hey, I seem to be doing something wrong as when I click on the button
on the page the message does not change?
-----------------------------------------------------------------------------------------------------------------------------
{% block title %}Person Form{% endblock %}
{% block content %}
<h3>{{ message }}</h3>
<from method="post">
<table>
{{ pForm }}
</table>
<input type="submit" name="submit" value="update" />
</form>
{% endblock %}
-----------------------------------------------------------------------------------------------------------------------------
class PersonForm(ModelForm):
class Meta:
model = Person
def person_form(request, pID='0'):
f = PersonForm()
message= 'Unknown Request'
p = get_object_or_404(Person,pk=pID)
if request.method == 'GET':
f = PersonForm(instance=p)
message = 'Editing person %s ' % p.name
if request.method == 'POST':
if request.POST['submit'] == 'update':
message = 'Update Request for %s ' % p.name
return render_to_response('People/person_form.html', {'pForm':
f,'message': message})
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---