Commit 7482423b authored by Serge S. Koval's avatar Serge S. Koval

Merge pull request #1172 from filmackay/patch-1

Handle 'MAX' column lengths
parents ea523fbd fcd0bf0b
......@@ -263,7 +263,7 @@ class AdminModelConverter(ModelConverterBase):
@classmethod
def _string_common(cls, column, field_args, **extra):
if column.type.length:
if isinstance(column.type.length, int) and column.type.length:
field_args['validators'].append(validators.Length(max=column.type.length))
@converts('String') # includes VARCHAR, CHAR, and Unicode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment