Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Validate that IntegerField is a valid Signed value
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Cal Leeming [Simplicity Media Ltd]  
View profile  
 More options Apr 30 2011, 12:45 pm
From: "Cal Leeming [Simplicity Media Ltd]" <cal.leem...@simplicitymedialtd.co.uk>
Date: Sat, 30 Apr 2011 17:45:20 +0100
Local: Sat, Apr 30 2011 12:45 pm
Subject: Validate that IntegerField is a valid Signed value

http://code.djangoproject.com/ticket/15923#comment:13

Currently, Django doesn't validate if a value on an IntegerField is indeed a
valid signed value.

Could someone please confirm (in others such as CharField) if value
validation is left for the database to decide (for example, string length,
encoding type etc), or is this validated within Django?

If it's validated within Django, then surely we should also be validating
IntegerField as well? If it's not, then I apologise.

Cal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Re : Validate that IntegerField is a valid Signed value" by Mathieu AGOPIAN
Mathieu AGOPIAN  
View profile  
 More options Apr 30 2011, 1:32 pm
From: Mathieu AGOPIAN <mathieu.agop...@gmail.com>
Date: Sat, 30 Apr 2011 10:32:40 -0700 (PDT)
Local: Sat, Apr 30 2011 1:32 pm
Subject: Re : Validate that IntegerField is a valid Signed value

Hello,

I'm afraid there isn't such a thing as "a valid signed value", if we're
still talking about "size wise".

For django (python), the integer you gave in the ticket is perfectly valid.
Here's a way for you to check that :

>>> s = '351760125423456632454565345363453423453465345453'
>>> int(s)

351760125423456632454565345363453423453465345453L

And indeed, an IntegerField validates that the content of the field can be
converted to an int this way (check django/forms/fields.py line 230).

So definitely, as Alex pointed, this is an issue on MySQL's side, not
Django's.
I believe this can't (shan't?) be fixed at Django's level, as there's no
"size" limitation for the IntegerField, as you would have on a CharField
with the *max_length* attribute.

And no, limiting the length of the string won't work, as "2147483647" isn't
the same length as "-2147483647", but is the same length as "9999999999" (if
we're taking the example of 2^32-1 as the max SIGNED INT value).

my two cents ;)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »