'Rename a field (actually: create a new Field instance with the
same attributes as the given Field, but a different field name).
@param field: the original Field instance
@param name: the new name
@param comments: render comments - if set to False, only
navigation items with an inline() renderer
method will be rendered (unless popup is None)
@param popup: only if comments=False, additional vars for comment
navigation items (e.g. AddResourceLink), None prevents
rendering of navigation items
@param skip_post_validation: skip field validation during POST,
useful for client-side processed
dummy fields.
@param label: override option for the original field label
@param widget: override option for the original field widget'

@staticmethod
def _rename_field(field, name, comments=True, popup=None, skip_post_validation=False, label=DEFAULT, widget=DEFAULT):

    if (not hasattr(field, 'type')):
        field = Storage(comment=None, type='string', length=255, unique=False, uploadfolder=None, autodelete=False, label='', writable=False, readable=True, default=None, update=None, compute=None, represent=(lambda v: (v or '')))
        requires = None
        required = False
        notnull = False
    elif (skip_post_validation and (current.request.env.request_method == 'POST')):
        requires = SKIP_POST_VALIDATION(field.requires)
        required = False
        notnull = False
    else:
        requires = field.requires
        required = field.required
        notnull = field.notnull
    if (widget is DEFAULT):
        widget = field.widget
    if (label is DEFAULT):
        label = field.label
    if (not comments):
        if popup:
            comment = field.comment
            if hasattr(comment, 'clone'):
                comment = comment.clone()
            if (hasattr(comment, 'renderer') and hasattr(comment, 'inline') and isinstance(popup, dict)):
                comment.vars.update(popup)
                comment.renderer = comment.inline
            else:
                comment = None
        else:
            comment = None
    else:
        comment = field.comment
    f = Field(str(name), type=field.type, length=field.length, required=required, notnull=notnull, unique=field.unique, uploadfolder=field.uploadfolder, autodelete=field.autodelete, widget=widget, label=label, comment=comment, writable=field.writable, readable=field.readable, default=field.default, update=field.update, compute=field.compute, represent=field.represent, requires=requires)
    return f
