On Jun 25, 2014, at 12:26 AM, Manish Godara <[email protected]> wrote:
> Hi,
> 
> Is there any way in current neutron codebase that can be used to validate
> the length of a string attribute against the max column size specified in
> the schema for that attribute.
> 
> E.g. , in models_v2.py
> 
> class Network(model_base.BASEV2, HasId, HasTenant):
>    """Represents a v2 neutron network."""
> 
>    name = sa.Column(sa.String(255))
>    ...
> 
> 
> And if I want to validate the 'name' before storing in db, then how can I
> get the max allowable length given this definition?  I don't see any such
> validations being done in neutron for fields, so wondering how to do it.
> Maybe it's there and I missed it.
> 


There’s not any length validation currently as the original v2 API spec never 
specified the max field length.  One of the changes being made as part of the 
REST layer refactoring is that we’re adding length validation.

mark
_______________________________________________
OpenStack-dev mailing list
[email protected]
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to