Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1069171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:22:57+00:00 2026-05-16T20:22:57+00:00

If I read out from a db I just saved files to I get:

  • 0

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)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:22:57+00:00Added an answer on May 16, 2026 at 8:22 pm

    But that’s not read from the database, it’s taken straight from the form submission. Instead, use the objects you’ve just saved. You’ll need to do a bit of extra formatting on the birthday though:

    % (contact.name, number.phonenumber, contact.address, 
       number.get_phone_type_display(), 
       contact.birth_day.strftime('%d/%m/%Y'))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering how I can read CSS comments out of a linked stylesheet.
which one of the two is more spread? I want to read out the
I read an interesting DailyWTF post today, Out of All The Possible Answers... and
I've read that compound primary keys will confuse the hell out of typical ORM
I read this PHP RegEx page , but either I'm missing something, misreading something,
Having read the threads Is SqlCommand.Dispose enough? and Closing and Disposing a WCF Service
I read somewhere once that the modulus operator is inefficient on small embedded devices
I read the Git manual, FAQ, Git - SVN crash course, etc. and they
Please read the whole question. I'm not looking for an approach to managing multi-lingual
I read in this article that a company has created a software capable of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.