def METHOD_NAME(self, mapping, update_only=False):
    for name in mapping:
        if update_only and name in self:
            # nested and inner objects, merge recursively
            if hasattr(self[name], "update"):
                # FIXME only merge subfields, not the settings
                self[name].METHOD_NAME(mapping[name], update_only)
            continue
        self.field(name, mapping[name])
    if update_only:
        for name in mapping._meta:
            if name not in self._meta:
                self._meta[name] = mapping._meta[name]
    else:
        self._meta.METHOD_NAME(mapping._meta)