Re: [sqlalchemy] Best practice for restricting input to columns?

2016-02-05 Thread Simon King
On Fri, Feb 5, 2016 at 2:15 PM, Michal Petrucha < michal.petru...@konk.org> wrote: > On Fri, Feb 05, 2016 at 08:24:46AM -0500, Alex Hall wrote: > > Hi all, > > What's the recommended way to restrict input? For instance, I store a > > phone number as an integer, and I need it to have 7, 10, or

Re: [sqlalchemy] Best practice for restricting input to columns?

2016-02-05 Thread Jonathan Vanasco
For validation, I use FormEncode, which is super old. Just to chime in on the above: 1. Phone Numbers should be strings. They can have a leading 0. Then you have to worry about extensions, etc. 2. Most people I know will do validation on a form, that is used to populate the sqlalchemy model

Re: [sqlalchemy] Best practice for restricting input to columns?

2016-02-05 Thread Michal Petrucha
On Fri, Feb 05, 2016 at 08:24:46AM -0500, Alex Hall wrote: > Hi all, > What's the recommended way to restrict input? For instance, I store a > phone number as an integer, and I need it to have 7, 10, or 11 digits. > In its getter, I format it so it looks good as a string, and in its > setter, I

[sqlalchemy] Best practice for restricting input to columns?

2016-02-05 Thread Alex Hall
Hi all, What's the recommended way to restrict input? For instance, I store a phone number as an integer, and I need it to have 7, 10, or 11 digits. In its getter, I format it so it looks good as a string, and in its setter, I take the string the user inputs, strip only the integers, and store