def set_fields(self, fields=None, *fields_args, **fields_kwargs):
        """
        completely replaces the current .fields with fields and fields_kwargs combined
        """
        if fields_args:
            fields = [fields]
            fields.extend(fields_args)
            for field_name in fields:
                self.set_field(field_name)

        elif fields_kwargs:
            fields = make_dict(fields, fields_kwargs)
            for field_name, field_val in fields.items():
                self.set_field(field_name, field_val)

        else:
            if isinstance(fields, Mapping):
                for field_name, field_val in fields.items():
                    self.set_field(field_name, field_val)

            else:
                for field_name in fields:
                    self.set_field(field_name)

        return self
def set_fields ( self , fields = None , * fields_args , ** fields_kwargs ) : if fields_args : fields = [ fields ] fields . extend ( fields_args ) for field_name in fields : self . set_field ( field_name ) elif fields_kwargs : fields = make_dict ( fields , fields_kwargs ) for field_name , field_val in fields . items ( ) : self . set_field ( field_name , field_val ) else : if isinstance ( fields , Mapping ) : for field_name , field_val in fields . items ( ) : self . set_field ( field_name , field_val ) else : for field_name in fields : self . set_field ( field_name ) return self
completely replaces the current .fields with fields and fields_kwargs combined