)]}'
{"keystone/identity/backends/sql.py":[{"author":{"_account_id":494,"name":"termie","email":"termie@openstack.org","username":"termie"},"change_message_id":"c3643689fe8c22e1e80ea6783ac1ea89703ae9f1","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def _validate_property(property_name, value, mandatory\u003dFalse,"},{"line_number":54,"context_line":"                       max_len\u003d64):"},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    Validate the length of the property value, raise ValidationError 400 if"},{"line_number":57,"context_line":"    length of value exceeds max_len or value not specified for mandatory."}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAFH%2F%2F8P4%3D","line":54,"updated":"2012-04-03 20:53:18.000000000","message":"while this is a generally okay check, the approach i\u0027d prefer to use for validations of this nature are more as follows:\n\ncreate a module, keystone/clean.py\n\nin clean you\u0027ll have some basic checks like this one, which could be done as something like\n\ndef require_length(...) \n\nor could be represented as a regex (use a \\w{min,max} style thing)\n\nThen, within that same file add specific ones like \n\ndef user_name(...):\n  do all the checks for a user name\n\ndef tenant_name(...):\n  do all the checks for a tenant name\n\nand upon entering a tenant_create one would say\n\ntenant_name \u003d clean.tenant_name(tenant[\u0027name\u0027])\n\nthrow an error if it is an unrecoverable problem, otherwise normalize appropriately and return the new value\n\n\nsome examples of this style here: http://code.google.com/p/jaikuengine/source/browse/trunk/common/clean.py","commit_id":"bd7ee7eb2a8cf555d0a4ec6fed5f25bde84a8ca9"}]}
