Make sure to delete fields inherited from an abstract model base.
170201
def base_definition_post_delete(sender, instance, **kwargs):
    
    if hasattr(instance._state, '_deletion'):
        # Make sure to flatten abstract bases since Django
        # migrations can't deal with them.
        model = popattr(instance._state, '_deletion')
        for field in instance.base._meta.fields:
            perform_ddl('remove_field', model, field)
467938
public function delFields()
    {
        $oSelectlist = oxNew(\OxidEsales\Eshop\Application\Model\SelectList::class);
        if ($oSelectlist->loadInLang($this->_iEditLang, $this->getEditObjectId())) {
            // Disable editing for derived items.
            if ($oSelectlist->isDerived()) {
                return;
            }

            $aDelFields = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aFields");
            $this->aFieldArray = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($oSelectlist->oxselectlist__oxvaldesc->getRawValue());

            if (is_array($aDelFields) && count($aDelFields)) {
                foreach ($aDelFields as $sDelField) {
                    $sDel = $this->parseFieldName($sDelField);
                    foreach ($this->aFieldArray as $sKey => $oField) {
                        if ($oField->name == $sDel) {
                            unset($this->aFieldArray[$sKey]);
                            break;
                        }
                    }
                }
                $this->save();
            }
        }
    }
1110494
function deleteAddedProtoTypes( Class ) {

		delete Class.prototype.Static;
		delete Class.prototype.Const;
		delete Class.prototype.Private;
		delete Class.prototype.Abstract;

		var currentState = saveState.pop();
        window.Private = currentState.Private;
        window.Const = currentState.Const;
        window.Abstract = currentState.Abstract;
        window.Static = currentState.Static;
	}
929017
def delete(self):
        """"""
        ret = False
        q = self.query
        pk = self.pk
        if pk:
            pk_name = self.schema.pk.name
            self.query.is_field(pk_name, pk).delete()
            setattr(self, pk_name, None)

            # mark all the fields that still exist as modified
            self.reset_modified()
            for field_name in self.schema.fields:
                if getattr(self, field_name, None) != None:
                    self.modified_fields.add(field_name)

            ret = True

        return ret
1072701
protected function clearFields()
    {
        // Void all the fields
        foreach (array_keys($this->data) as $fieldName) {
            /** @var FieldCollection $field */
            $field = $this->data[$fieldName];

            $field->clear();
            $field->syncOriginal();
        }
    }
400090
def remove(self, models):
        
        models = self._check_model_types(models)
        for model in models:
            if model in self._selected:
                self._selected.remove(model)
1217245
def _delete_null_columns(self):
        
        ds = DeleteStatement(self.column_family_name)
        deleted_fields = False
        for _, v in self.instance._values.items():
            col = v.column
            if v.deleted:
                ds.add_field(col.db_field_name)
                deleted_fields = True
            elif isinstance(col, Map):
                uc = MapDeleteClause(col.db_field_name, v.value, v.previous_value)
                if uc.get_context_size() > 0:
                    ds.add_field(uc)
                    deleted_fields = True

        if deleted_fields:
            for name, col in self.model._primary_keys.items():
                ds.add_where_clause(WhereClause(
                    col.db_field_name,
                    EqualsOperator(),
                    col.to_database(getattr(self.instance, name))
                ))
            self._execute(ds)
315427
def _clean_schema_fields(self, fields):
        """"""
        fields_sorted = sorted(fields, key=lambda field: field["name"])
        # Ignore mode and description when comparing schemas.
        return [
            {"name": field["name"], "type": field["type"]}
            for field in fields_sorted
        ]
329006
def remove_field(self, field_name):
        """"""
        field = self._fields.pop(field_name, None)
        if field is not None and field.default is not None:
            if six.callable(field.default):
                self._default_callables.pop(field.key, None)
            else:
                self._defaults.pop(field.key, None)
562947
public function generateRemovedFields()
    {
        foreach ($this->keptModelKeys as $modelName) {
            $oldFieldKeys = $this->oldFieldKeys[$modelName];
            $newFieldKeys = $this->newFieldKeys[$modelName];

            $remFields = array_diff($oldFieldKeys, $newFieldKeys);

            foreach ($remFields as $remField) {
                $this->findRemovedFields($modelName, $remField);
            }
        }
    }
112045
def base_definition_pre_delete(sender, instance, **kwargs):
    
    # see CASCADE_MARK_ORIGIN's docstring
    cascade_deletion_origin = popattr(
        instance._state, '_cascade_deletion_origin', None
    )
    if cascade_deletion_origin == 'model_def':
        return
    if (instance.base and issubclass(instance.base, models.Model) and
            instance.base._meta.abstract):
        instance._state._deletion = instance.model_def.model_class().render_state()
904385
def clear_relation(cls):
        
        for k, v in cls.properties.items():
            if isinstance(v, ReferenceProperty):
                if hasattr(v, 'collection_name') and hasattr(v.reference_class, v.collection_name):
                    delattr(v.reference_class, v.collection_name)

                    if isinstance(v, OneToOne):
                        #append to reference_class._onetoone
                        del v.reference_class._onetoone[v.collection_name]
1274379
def clean_cache(cached, **kwargs):
    "  "

    if isinstance(cached, basestring):
        cached = _str_to_model(cached)

    cache_key = generate_cache_key(cached, **kwargs)
    cache.delete(cache_key)
984692
protected function deleteOrphanedAbilities()
    {
        $query = $this->getBaseOrphanedQuery()->where(function ($query) {
            foreach ($this->getEntityModels() as $modelName) {
                $query->orWhere(function ($query) use ($modelName) {
                    $this->scopeQueryToWhereModelIsMissing($query, $modelName);
                });
            }
        });

        if (($count = $query->count()) > 0) {
            $query->delete();

            $this->info("Deleted {$count} orphaned ".Str::plural('ability', $count).'.');
        } else {
            $this->info('No orphaned abilities.');
        }
    }
1364760
def _from_rest_ignore(model, props):
    

    fields = model.all_fields

    for prop in props.keys():
        if prop not in fields:
            del props[prop]
835063
def deregister(cls, attr_name):
        
        try:
            field = cls.get_field_by_fieldname(attr_name)
        except InvalidField:
            raise ValueError("'%s' is not registered" % attr_name)
        if not isinstance(field, ExtendedPropertyField):
            raise ValueError("'%s' is not registered as an ExtendedProperty" % attr_name)
        cls.remove_field(field)
368363
def remove_attributes(self, model):
        
        for child in model.children():
            if 'nn.modules.container' in str(type(child)):
                self.remove_attributes(child)
            else:
                try:
                    del child.x
                except AttributeError:
                    pass
                try:
                    del child.y
                except AttributeError:
                    pass