[storm] Size Validation
James Henstridge
james at jamesh.id.au
Mon Jul 7 04:39:06 BST 2008
On Sun, Jul 6, 2008 at 11:30 PM, Gerdus van Zyl <gerdusvanzyl at gmail.com> wrote:
> Hi,
>
> Is there any already built in method in storm to specify the size of a
> varchar ? eg. varchar(25) that throws an exception if the string is
> more than 25 chars long. On a similar note: you can currently prevent
> the use of None for notnull columns using allow_none=False; is there
> something that prevent an empty string?
If you are using the latest trunk version of Storm (not the 0.12
tarball release), you could define a validator to do this:
def validate_length(obj, attr_name, value):
More information about the storm
mailing list