Deletes a saved a dashboard record
7954
protected function deleteDashboard()
    {
        $this->controlAccess('dashboard_edit');

        if ($this->dashboard->delete($this->data_dashboard['dashboard_id'])) {
            $message = $this->text('Your dashboard has been reset');
            $this->redirect('', $message, 'success');
        }

        $this->redirect('admin', $this->text('Your dashboard has not been reset'), 'warning');
    }
895182
def delete(self, rid, raise_on_error=True):
        
        return self.ds.delete(rid, raise_on_error)
757468
def destroy(self, force=False):
        
        if self.persisted:
            if self.soft_delete and not force:
                self.__class__.update(
                    values={
                        self.__class__.deleted_at_column(): datetime.utcnow()
                        },
                    where=self.where_self
                    )
            else:
                self.__class__.delete(
                    where=self.where_self,
                    skip_soft_delete=True
                    )
        else:
            raise RecordNotPersisted("Record's primary key is None")
605986
def delete(self):
        '''
        

        '''
        versions = self.get_versions()
        self.api.manager.delete_archive_record(self.archive_name)

        for version in versions:
            if self.authority.fs.exists(self.get_version_path(version)):
                self.authority.fs.remove(self.get_version_path(version))

            if self.api.cache:
                if self.api.cache.fs.exists(self.get_version_path(version)):
                    self.api.cache.fs.remove(self.get_version_path(version))

        if self.authority.fs.exists(self.archive_name):
            self.authority.fs.removedir(self.archive_name)

        if self.api.cache:
            if self.api.cache.fs.exists(self.archive_name):
                self.api.cache.fs.removedir(self.archive_name)
146909
function removeRecord(options) {
    let query = getQueryParams(options, ['name', 'content', 'type', 'query']);
    return find(options.domain, query).then(function (response) {
      let records = response.data.result;
      if (records.length === 0) {
        throw new Error('No matching records found');
      }
      let results = [];
      _.each(records, function (record) {
        results.push(self.cloudflareClient.removeRecord(record.zone_id, record.id));
      });
      return Promise.all(results);
    }).then(function (responses) {
      let messages = _.map(responses, function (response) {
        return 'Deleted record with id ' + response.data.result.id;
      });

      return new Result(messages);
    });
  }
631449
public function delete(Dashboard $dashboard)
    {
        $this->em->remove($dashboard);
        $this->em->flush();
    }
873384
public function delete()
    {
        if (!$this->isNewRecord) {
            $item = Yii::$app->authManager->getRole($this->name);
            if ($item) {
                Yii::$app->authManager->remove($item);
            }
        }
    }
655208
def delete(self, force=False):
        
        if force:
            RecordsBuckets.query.filter_by(
                record=self.model,
                bucket=self.files.bucket
            ).delete()
        return super(Record, self).delete(force)
740979
def delete(ids, force):
    """"""
    records_deprecation_warning()

    from .api import Record
    for id_ in ids:
        record = Record.get_record(id_, with_deleted=force)
        record.delete(force=force)
    db.session.commit()
1070043
def delete(self,removed):
        
        if isinstance(removed,dict):
            # remove a single record
            removed = [removed]
        else:
            # convert iterable into a list (to be able to sort it)
            removed = [ r for r in removed ]
        if not removed:
            return 0
        _ids = [ r['__id__'] for r in removed ]
        _ids.sort()
        keys = set(self.records.keys())
        # check if the records are in the base
        if not set(_ids).issubset(keys):
            missing = list(set(_ids).difference(keys))
            raise IndexError,'Delete aborted. Records with these ids' \
                ' not found in the base : %s' %str(missing)
        # raise exception if duplicate ids
        for i in range(len(_ids)-1):
            if _ids[i] == _ids[i+1]:
                raise IndexError,"Delete aborted. Duplicate id : %s" %_ids[i]
        deleted = len(removed)
        while removed:
            r = removed.pop()
            _id = r['__id__']
            # remove id from indices
            for indx in self.indices.keys():
                pos = bisect.bisect(self.indices[indx][r[indx]],_id)-1
                del self.indices[indx][r[indx]][pos]
                if not self.indices[indx][r[indx]]:
                    del self.indices[indx][r[indx]]
            # remove record from self.records
            del self.records[_id]
        return deleted
902516
def destroy
      m = model.find(user_scoped.find(params[:id]).id)
      @record_saved = m     # copy for possible later use
      m.destroy

      prepare_list
      @record = model.new
      @flash_notice = t('delete_ok')
    end
562683
protected function deleteOldFiles()
    {
        $repository = new DashboardRepository();

        $files = $repository->getFiles();
        $items = [];

        /** @var \SplFileInfo $file */
        foreach ($files as $file) {
            $items[$file->getMTime()] = $file;
        }

        krsort($items);

        $i = 0;

        /** @var \SplFileInfo $file */
        foreach ($items as $file) {
            $i++;

            if ($i < 100) {
                continue;
            }

            File::delete($file->getPathname());
        }
    }
95182
def delete(self, dash_id):
        
        removed_info = dict(
            time_modified = r_db.zscore(config.DASH_ID_KEY, dash_id),
            meta = r_db.hget(config.DASH_META_KEY, dash_id),
            content = r_db.hget(config.DASH_CONTENT_KEY, dash_id))
        r_db.zrem(config.DASH_ID_KEY, dash_id)
        r_db.hdel(config.DASH_META_KEY, dash_id)
        r_db.hdel(config.DASH_CONTENT_KEY, dash_id)
        return {'removed_info': removed_info}
993639
def delete_saved_aggregation_by_slug(request, slug):
    """"""
    ss = get_object_or_404(Aggregation, slug=slug)
    ss.delete()
    messages.success(request, _("Saved aggregation deleted."))
    return HttpResponseRedirect(
        reverse(
            'djmongo_browse_saved_aggregations_w_params',
            args=(
                ss.database_name,
                ss.collection_name)))
252597
def delete_records(keep=20):
    """"""
    sql = "SELECT * from records where is_deleted<>1 ORDER BY id desc LIMIT -1 offset {}".format(keep)
    assert isinstance(g.db, sqlite3.Connection)
    c = g.db.cursor()
    c.execute(sql)
    rows = c.fetchall()
    for row in rows:
        name = row[1]
        xmind = join(app.config['UPLOAD_FOLDER'], name)
        xml = join(app.config['UPLOAD_FOLDER'], name[:-5] + 'xml')

        for f in [xmind, xml]:
            if exists(f):
                os.remove(f)

        sql = 'UPDATE records SET is_deleted=1 WHERE id = ?'
        c.execute(sql, (row[0],))
        g.db.commit()
246487
def delete(self, records, context):
        
        # include various schema records to remove
        DELETE = self.statement('DELETE')
        sql, data = DELETE(records, context)

        if context.dryRun:
            print sql % data
            return 0
        else:
            return self.execute(sql, data, writeAccess=True)
906431
def delete_authorized?(record = nil)
      (!nested? || !nested.readonly?) && (record || self).authorized_for?(crud_type: :delete, reason: true)
    end