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

  • SEARCH
  • Home
  • 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 1097405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:25:42+00:00 2026-05-17T00:25:42+00:00

Prior to today, I’ve been using Django 1.1. To ensure I’m keeping up with

  • 0

Prior to today, I’ve been using Django 1.1. To ensure I’m keeping up with the times, I decided to update my Django environment to use Django 1.2.3. Unfortunately, I’ve encountered an issue.

The following code did not raise a ValueError in 1.1:

        instance = FormClass(
            request.POST,
            instance=existing_instance
        ).save(commit=False)

However, now that I’ve upgraded, it raises a ValueError each time. I have a SSN field that I’m submitting as part of my Form and I strip out the dashes prior to doing an instance.save() call. Unfortunately, the ValueError occurs because Django thinks my SSN value is too long (it’s expecting 9 characters and it’s receiving 11 — 123-45-6789).

I’ve looked through the Django docs and I couldn’t find anything relating to this change. Any idea what’s going on? I’ve always thought the purpose of the “commit=False” parameter was to allow pre-processing of data before saving the information.

Am I missing something?

  • 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-17T00:25:43+00:00Added an answer on May 17, 2026 at 12:25 am

    According to the 1.2 docs on the save() method, “If you call save() with commit=False, then it will return an object that hasn’t yet been saved to the database.” So I’m not sure why there would have been a change in functionality, but it’s possible that in 1.1 validation/check code ran only when an object was saved to the database, and in 1.2 it happens earlier (before the object is saved).

    In any case, if you’re cleaning data that is being entered in a form, you should probably be cleaning it in the FormClass:

    def clean_ssn(self):
        data = re.sub(r'[^0-9]','',self.cleaned_data['ssn'])
        #validation code here
        return data
    

    That should at least fix the problem…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Prior to the asp.net 4 RC update, I had been using the WebApi for
I have a project that's been using font-face without problem for some time. Today
I've been using a vanilla apache install until recently with no major problems. Today
I have a datepicker and it can not allow dates prior to today VIA
I noticed prior to posting this question that there have been similar questions posted
I've been using a program, compiled using GCC 4.4.1 (ISO C99) and noticed this
I just received some really great help today with a prior jQuery problem and
Here is what I'm struggling with today: I'm trying to draw a graph using
I am trying to fetch the date 7days prior to today's date. I am
Today I've dropped back into a project that I haven't been working with for

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.