KERNEL: fix size for selection field

bzr revid: ced-89449eb987bcbbbcdb85a0354d19103e7dfe90b4
This commit is contained in:
ced 2007-05-31 05:42:52 +00:00
parent 44e684b2c7
commit c982279049
1 changed files with 1 additions and 1 deletions

View File

@ -233,7 +233,7 @@ def get_pg_type(f):
f_type = ('varchar', 'VARCHAR(%d)' % (f.size,))
elif isinstance(f, fields.selection):
if isinstance(f.selection, list) and isinstance(f.selection[0][0], (str, unicode)):
f_size = reduce(lambda x,y: max(x,len(y[0])), f.selection, 16)
f_size = reduce(lambda x,y: max(x,len(y[0])), f.selection, f.size or 16)
elif isinstance(f.selection, list) and isinstance(f.selection[0][0], int):
f_size = -1
else: