'Date field constructor
@param tablename: the table name
@param row: the s3_field Row
@return: the Field instance'

@staticmethod
def _date_field(tablename, row):

    fieldname = row.name
    settings = (row.settings or {})
    attr = {}
    for keyword in ('past', 'future'):
        setting = settings.get(keyword, DEFAULT)
        if (setting is not DEFAULT):
            attr[keyword] = setting
    attr['empty'] = False
    default = row.default_value
    if default:
        if (default == 'now'):
            attr['default'] = default
        else:
            from s3datetime import s3_decode_iso_datetime
            try:
                dt = s3_decode_iso_datetime(default)
            except ValueError:
                pass
            else:
                attr['default'] = dt.date()
    from s3fields import s3_date
    field = s3_date(fieldname, **attr)
    return field
