If I "read out" from a db I just saved files to I get:
Your Name is: (u'Mike',)
Your Birthday is on: (datetime.datetime(2009, 12, 5, 0, 0),)
Instead of
Your Name is Mike
Your Birthday is on the 12/05/2009
How can I achieve this?
Thanks
@ Daniel:
The same is my example you answered just before:
this is how it is saved:
def main(request):
if request.method == 'POST':
form = UserForm(request.POST)
if form.is_valid():
name = form.cleaned_data['name'],
birth_day = form.cleaned_data['birth_day'],
address = form.cleaned_data['address'],
# contact1= form.cleaned_data['id']
phone_type = form.cleaned_data['phone_type']
phonenumber = form.cleaned_data['phonenumber']
contact = Contact(
name = form.cleaned_data['name'],
birth_day = form.cleaned_data['birth_day'],
address = form.cleaned_data['address'],
)
contact.save()
number = PhoneNumber(
# contact1 = form.cleaned_data ['id']
contact = contact,
phone_type = form.cleaned_data['phone_type'],
phonenumber = form.cleaned_data['phonenumber'],
)
number.save()
and this how it is displayed:
output = '''
<html>
<head>
<title> Your telephone number </title>
</head>
<body>
<h1> Your telephone number</h1>
<p>Your Name is: %s </p>
<p>Your Telephone number is : %s </p>
<p>Your Address is: %s </p>
<p>This is your %s number </p>
<p>Your Birthday is on: %s </p>
</body>
</html>''' %( name, phonenumber, address, phone_type, birth_day)
return HttpResponse(output)