When a model is removed from a 'HasMany', trigger 'remove' on 'this.instance' and notify reverse relations.
(should be 'HasOne', which should be nullified)
335626
function( model, coll, options ) {
			//console.debug('handleRemoval called; args=%o', arguments);
			options = this.sanitizeOptions( options );
			
			_.each( this.getReverseRelations( model ), function( relation ) {
					relation.removeRelated( this.instance, options );
				}, this );
			
			var dit = this;
			Backbone.Relational.eventQueue.add( function() {
				!options.silentChange && dit.instance.trigger( 'remove:' + dit.key, model, dit.related, options );
			});
		}
865869
def remove(self,obj):
        
        relationship_table = self.params['relationship_table']
        with self.obj.backend.transaction(implicit = True):
            condition = and_(relationship_table.c[self.params['related_pk_field_name']] == obj.pk,
                             relationship_table.c[self.params['pk_field_name']] == self.obj.pk)
            self.obj.backend.connection.execute(delete(relationship_table).where(condition))
            self._queryset = None
334280
function(view, options) {
        options = _.extend({}, options);
        var model = options.model || view.model,
            collection = options.collection || view.collection;

        if(model) {
          unbindModel(model, view);
        }
        else if(collection) {
          collection.each(function(model){
            unbindModel(model, view);
          });
          collection.unbind('add', collectionAdd);
          collection.unbind('remove', collectionRemove);
        }
      }
464025
def _check_instance_relationships_for_delete(self, instance):
        
        check_permission(instance, None, Permissions.DELETE)
        for rel_key, rel in instance.__mapper__.relationships.items():
            check_permission(instance, rel_key, Permissions.EDIT)

            if rel.cascade.delete:
                if rel.direction == MANYTOONE:
                    related = getattr(instance, rel_key)
                    self._check_instance_relationships_for_delete(related)
                else:
                    instances = getattr(instance, rel_key)
                    for to_check in instances:
                        self._check_instance_relationships_for_delete(to_check)
501421
def unregister_model(self, model):
        
        if model not in self._model_registry:
            raise NotRegistered('The model %s is not registered' % model)

        del self._model_registry[model]
1281489
protected function onBeforeDelete()
    {
        $this->brokenOnDelete = false;

        $dummy = null;
        $this->extend('onBeforeDelete', $dummy);

        // Cascade deletes
        $deletes = $this->findCascadeDeletes(false);
        foreach ($deletes as $delete) {
            $delete->delete();
        }
    }
266721
def remove_instance(self):
        
        with fields.FieldLock(self.related_field):
            related_pks = self()
            for pk in related_pks:

                # get the real related field
                related_instance = self.related_field._model(pk)
                related_field = getattr(related_instance, self.related_field.name)

                # check if we have a dedicated remove method
                remover = getattr(related_field, '_related_remover', None)

                # then remove the instance from the related field
                if remover is not None:
                    # if we have a remover method, it wants the instance as argument
                    # (the related field may be a set/list/sorted_set)
                    getattr(related_field, remover)(self.instance._pk)
                else:
                    # no remover method, simple delete the field
                    related_field.delete()
1240908
function( model ) {
			model.unbind( 'destroy', this.unregister );
			var coll = this.getCollection( model );
			coll && coll.remove( model );
		}
115362
def drop(self, ex):
    ""
    # todo: factor out inheritance logic (for readability)
    if ex.name not in self:
      if ex.ifexists: return
      raise KeyError(ex.name)
    table_ = self[ex.name]
    parent = table_.parent_table
    if table_.child_tables:
      if not ex.cascade:
        raise table.IntegrityError('delete_parent_without_cascade',ex.name)
      self.cascade_delete(ex.name)
    else: del self[ex.name]
    if parent: parent.child_tables.remove(table_)
1331835
function(models, options) {
    if(!models) return false;
    this.remove(models, options);
    var singular = !_.isArray(models);
    models = singular ? [models] : _.clone(models);
    return this._callAdapter('removeFromIndex', options, models);
  }
473148
function(model, options) {
            var index;

            if (_.isArray(model)) {
                _.each(model, function(m) {
                    this.remove(m, options);
                }, this);
                return this;
            }

            options = _.defaults(options || {}, {
                silent: false
            });

            model = this._prepareModel(model);

            _.each(this.models, function(m, i) {
                if (!m || model.id == m.id) {
                    this.models.splice(i, 1);
                    index = i;
                    return;
                }
            }, this);
            delete this._byId[model.id];

            if (options.silent) return this;
            options.index = index;
            if (this._totalCount != null) this._totalCount = _.max([0, this._totalCount - 1]);
            this.trigger('remove', model, this, options);
            this._removeReference(model);

            return this;
        }
1103741
public function doDelete($model, $id)
    {
        if ($this->weak) {
            return;
        }

        $delete = $this->dsql();
        if ($this->reverse) {
            $delete->where($this->foreign_field, $this->owner->id);
        } else {
            $delete->where($this->foreign_field, $this->owner[$this->master_field]);
        }

        $delete->delete()->execute();
    }
944637
def showRemoveColumnDialog(self, triggered):
        
        if triggered:
            model = self.tableView.model()
            if model is not None:
                columns = model.dataFrameColumns()
                dialog = RemoveAttributesDialog(columns, self)
                dialog.accepted.connect(self.removeColumns)
                dialog.rejected.connect(self.uncheckButton)
                dialog.show()
787185
def _notify_remove(self, slice_):
        """"""
        change = RemoveChange(self, slice_)
        self.notify_observers(change)
1176716
function(models, options) {
      var removed = [];
      for (var i = 0; i < models.length; i++) {
        var model = this.get(models[i]);
        if (!model) continue;

        var index = this.indexOf(model);
        this.models.splice(index, 1);
        this.length--;

        // Remove references before triggering 'remove' event to prevent an
        // infinite loop. #3693
        delete this._byId[model.cid];
        var id = this.modelId(model.attributes);
        if (id != null) delete this._byId[id];

        if (!options.silent) {
          options.index = index;
          model.trigger('remove', model, this, options);
        }

        removed.push(model);
        this._removeReference(model, options);
      }
      return removed;
    }
722731
function() {
    var self = this

    Object.keys(this.definition.relations).forEach(function(key) {
      delete self.relations[key]
    })

    return this
  }
884811
def _on_model_delete(sender, **kwargs):
    """"""
    instance = kwargs.pop("instance")
    for index in instance.search_indexes:
        try:
            _delete_from_search_index(instance=instance, index=index)
        except Exception:
            logger.exception("Error handling 'on_delete' signal for %s", instance)