On Thu, Mar 12, 2009 at 2:26 PM, xankya <suzan.sha...@gmail.com> wrote:

>
> I created an integer field for a mobile number as
> mobile = models.IntegerField(max_length=20)
>
> In MySQL interface, it created an integer field with length 11.
>
> So my question is how to create bigint in mysql for storing big
> numbers such as mobile number.
>
> And my another mysql newbie question is why int(length=20) in mysql
> can't store 10 digit number?


Specifying max_length on a Django model IntegerField has no effect.
max_length is an allowed parameter on any field, but it is not used except
by those fields (such as CharField) that are documented to use the value.


> and is bigint(length=5) different that int
> (length=5)?


I'm not sure what you are asking here?  Django doesn' t have a big integer
field.  Your choices (unless you want to use a custom field) are Integer and
SmallInteger, which map (on MySQL) to integer and smallint respectively.
There is an old ticket (#399) requesting a BigInt field, but it has not been
completed.  (Since it was opened it has become much more easy to write your
own custom fields so adding this ticket to core became not as important as
originally.)

Anyway, I'm not sure why you need to store a phone number as an integer?  A
CharField with (formfield-level, at the moment) validation to ensure it's
got the right number of digits or whatever would seem to work fine.

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to