def get_field_SQL(self, field_name, field):
field_type = "<STR_LIT>"<EOL>is_pk = field.options.get('<STR_LIT>', False)<EOL>if issubclass(field.type, bool):<EOL><INDENT>field_type = '<STR_LIT>'<EOL><DEDENT>elif issubclass(field.type, long):<EOL><INDENT>if is_pk:<EOL><INDENT>field_type = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>field_type = '<STR_LIT>'<EOL><DEDENT><DEDENT>elif issubclass(field.type, int):<EOL><INDENT>field_type = '<STR_LIT>'<EOL>if is_pk:<EOL><INDENT>field_type += '<STR_LIT>'<EOL><DEDENT><DEDENT>elif issubclass(field.type, basestring):<EOL><INDENT>fo = field.options<EOL>if field.is_ref():<EOL><INDENT>ref_s = field.schema<EOL>fo = ref_s.pk.options<EOL><DEDENT>if '<STR_LIT:size>' in fo:<EOL><INDENT>field_type = '<STR_LIT>'.format(fo['<STR_LIT:size>'])<EOL><DEDENT>elif '<STR_LIT>' in fo:<EOL><INDENT>field_type = '<STR_LIT>'.format(fo['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>field_type = '<STR_LIT>'<EOL><DEDENT>if fo.get('<STR_LIT>', False):<EOL><INDENT>field_type += '<STR_LIT>'<EOL><DEDENT>if is_pk:<EOL><INDENT>field_type += '<STR_LIT>'<EOL><DEDENT><DEDENT>elif issubclass(field.type, datetime.datetime):<EOL><INDENT>field_type = '<STR_LIT>'<EOL><DEDENT>elif issubclass(field.type, datetime.date):<EOL><INDENT>field_type = '<STR_LIT>'<EOL><DEDENT>elif issubclass(field.type, float):<EOL><INDENT>field_type = '<STR_LIT>'<EOL>size = field.options.get('<STR_LIT:size>', field.options.get('<STR_LIT>', <NUM_LIT:0>))<EOL>if size > <NUM_LIT:6>:<EOL><INDENT>field_type = '<STR_LIT>'<EOL><DEDENT><DEDENT>elif issubclass(field.type, decimal.Decimal):<EOL><INDENT>field_type = '<STR_LIT>'<EOL><DEDENT>elif issubclass(field.type, bytearray):<EOL><INDENT>field_type = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(field.type.__name__))<EOL><DEDENT>if field.required:<EOL><INDENT>field_type += '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>field_type += '<STR_LIT>'<EOL><DEDENT>if not is_pk:<EOL><INDENT>if field.is_ref():<EOL><INDENT>ref_s = field.schema<EOL>if field.required: <EOL><INDENT>field_type += '<STR_LIT>'.format(<EOL>ref_s,<EOL>ref_s.pk.name<EOL>)<EOL><DEDENT>else: <EOL><INDENT>field_type += '<STR_LIT>'.format(<EOL>ref_s,<EOL>ref_s.pk.name<EOL>)<EOL><DEDENT><DEDENT><DEDENT>return '<STR_LIT>'.format(self._normalize_name(field_name), field_type)<EOL>
returns the SQL for a given field with full type information

http://www.sqlite.org/datatype3.html

field_name -- string -- the field's name
field -- Field() -- the set options for the field

return -- string -- the field type (eg, foo BOOL NOT NULL)