Fwd: Re : Validate that IntegerField is a valid Signed value

2011-05-01 Thread Cal Leeming [Simplicity Media Ltd]
Done [Django] #15939 : SignedIntegerField? / UnsignedIntegerField? as part of the core fields.py [Django] #15940

Re: Re : Validate that IntegerField is a valid Signed value

2011-05-01 Thread Mathieu AGOPIAN
I really can't tell if those two new fields would be integrated in core, either wait for feedback here, and/or give it a try with a ticket (and i'm pretty sure it'll land in "Design Decision Needed"). On May 1, 2:42 pm, "Cal Leeming [Simplicity Media Ltd]" wrote: > Yeah, subclassing sounds the wa

Re : Validate that IntegerField is a valid Signed value

2011-05-01 Thread Cal Leeming [Simplicity Media Ltd]
Yeah, subclassing sounds the way forward. I was thinking something like: SignedIntegerField = IntegerField(min_value=–2147483648, max_value= 2147483647) UnsignedIntegerField = IntegerField(min_value=0, max_value=4294967295) Do you think there would be much chance in having these two field types i

Re: Re : Validate that IntegerField is a valid Signed value

2011-05-01 Thread Mathieu AGOPIAN
For reference, this discussion is linked to http://groups.google.com/group/django-developers/browse_thread/thread/f0b8ddbda03a2d8e and to the ticket http://code.djangoproject.com/ticket/15923 Cal, The only thing that i could imagine regarding "fixing" this issue would indeed be a documentation ad

Re: Re : Validate that IntegerField is a valid Signed value

2011-04-30 Thread Cal Leeming [Simplicity Media Ltd]
Hey Mathieu, Thanks for taking the time to reply. I'm starting to see now why the core devs are reluctant to modify IntegerField. I'm wondering if maybe Django should have a SignedIntegerField and UnsignedIntegerField as part of the core (for those that wish to have enforced 32-bit integers), wit

Re : Validate that IntegerField is a valid Signed value

2011-04-30 Thread Mathieu AGOPIAN
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)

Re : Validate that IntegerField is a valid Signed value

2011-04-30 Thread Mathieu AGOPIAN
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)

Validate that IntegerField is a valid Signed value

2011-04-30 Thread Cal Leeming [Simplicity Media Ltd]
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, enc