Skip to content
This repository has been archived by the owner on Jun 20, 2020. It is now read-only.

Commit

Permalink
Making the third step definition works
Browse files Browse the repository at this point in the history
  • Loading branch information
fsouza committed Jul 8, 2010
1 parent 05d1a76 commit 0dc14be
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
6 changes: 6 additions & 0 deletions school/forms.py
@@ -0,0 +1,6 @@
from django import forms
from models import Student

class StudentForm(forms.ModelForm):
class Meta:
model = Student
9 changes: 9 additions & 0 deletions school/templates/form_new_student.html
@@ -0,0 +1,9 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>New student</title>
</head>
<body id="">
{{ form.as_p }}
</body>
</html>
10 changes: 8 additions & 2 deletions school/views.py
@@ -1,5 +1,11 @@
# Create your views here.
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from forms import StudentForm

def new_student(request):
return HttpResponse('Hi!')
form = StudentForm()
return render_to_response('form_new_student.html', {
'form' : form
}, context_instance=RequestContext(request)
)

0 comments on commit 0dc14be

Please sign in to comment.