adam wrote:
> Hello,
>
> i am trying to store telephone numbers in a database and the 0 are
> being stripped off and i dont know why. Here is the dictionary of
> information being entered
>
> {'town': u'', 'surname': u'', 'mobile': u'07841633135', 'address1':
> u'', 'address2': u'', 'telephone': u'01439771952', 'submit': u'Add',
> 'county': u'', 'street': u'', 'postcode': u'', 'forename': u'john',
> 'group': u'6', 'country': u'', 'email': u''}
>
> and this is what i get into the database
>
> 6|www.adamplowman.co.uk|6|john|||||||||1439771952|7841633135|
>
> the telephone fields in the database are set to
>
> column(Integer)
>
Probably due to the Integer, unless you do special formating the leading
zeros are normally not shown.
You probably want to use a varchar instead of string.
This will also allow you to store numbers in this format, e.g. a French
phone number:
+33 5 53 22 22 22
"+" is basically an International standard to represent the
international dialing access code (most often this is 00 but there are
others).
On a GSM phone the above will always work regards less if you call from
France or from another country. If your application does the dialing
then you would either have to leave the +33 if dialing from outside of
France or strip it and replace it by a leading 0 if dialing from France.
Just my 0.02€
Werner
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---