On Thursday 23 July 2009 14:03:05 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)
>
> What am i missing?That column(Integer) will only store integers, and those don't have prefix-zeros. Or what would you then expect to happen if you store 0000001 and 001 into the DB? Use as string instead. And put validation on your forms if you want to enforce a certain look of the telephone-numbers (aka them being numbers) Diez --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

