'Convert a s3_field Row into a Field instance
@param tablename: the table name
@param row: the s3_field Row
@return: a Field instance'

@classmethod
def _field(cls, tablename, row):

    field = None
    if row:
        fieldtype = row.field_type
        if row.options:
            construct = cls._options_field
        elif (fieldtype == 'date'):
            construct = cls._date_field
        elif (fieldtype == 'datetime'):
            construct = cls._datetime_field
        elif (fieldtype[:9] == 'reference'):
            construct = cls._reference_field
        elif (fieldtype == 'boolean'):
            construct = cls._boolean_field
        elif (fieldtype in ('integer', 'double')):
            construct = cls._numeric_field
        else:
            construct = cls._generic_field
        field = construct(tablename, row)
        if (not field):
            return None
        requires = field.requires
        if (fieldtype != 'boolean'):
            if row.require_not_empty:
                if (not requires):
                    requires = IS_NOT_EMPTY()
            elif requires:
                requires = IS_EMPTY_OR(requires)
        field.requires = requires
        T = current.T
        label = row.label
        if (not label):
            fieldname = row.name
            label = '    '.join((s.capitalize() for s in fieldname.split('_')))
        if label:
            field.label = T(label)
        comments = row.comments
        if comments:
            field.comment = T(comments)
    return field
