FormAlchemy / formalchemy

MIT License
81 stars 29 forks source link

Fixed string formatting in the length validator #55

Open brukhabtu opened 10 years ago

brukhabtu commented 10 years ago

The length validator would return 'Value must be no more than %(max)d characters long' without substituting min/max. Replacing with new style string formatting has fixed this.

aconrad commented 10 years ago

Can you illustrate this problem a little more, I'm having a hard time understanding what the problem is exactly. Is this a scoping / closure issue with the namespace of the builtins min and max? If yes, why not change the function's params to be min_length and max_lenght?

I'm not against using format(), I'm just trying to understand how format fixes your problem.