Render response for view `delete_many` method (collection DELETE)
190141
def render_delete_many(self, value, system, common_kw):
        
        if isinstance(value, dict):
            return JHTTPOk(extra=value)
        msg = 'Deleted {} {}(s) objects'.format(
            value, system['view'].Model.__name__)
        return JHTTPOk(msg, **common_kw.copy())
1189622
def show
      respond_to do |wants|
        wants.html { presenter }
        wants.json { presenter }
        additional_response_formats(wants)
      end
    end
1124703
def get(self, request, *args, **kwargs):
        
        self.object = self.get_object()
        can_delete = True
        protected_objects = []
        collector_message = None
        collector = Collector(using="default")
        try:
            collector.collect([self.object])
        except ProtectedError as e:
            collector_message = (
                "Cannot delete %s because it has relations "
                "that depends on it." % self.object
            )
            protected_objects = e.protected_objects
            can_delete = False

        if can_delete and self.redirect:
            messages.success(request, self.get_success_message(self.object))
            return self.delete(request, *args, **kwargs)

        context = self.get_context_data(
            object=self.object,
            can_delete=can_delete,
            collector_message=collector_message,
            protected_objects=protected_objects,
        )
        return self.render_to_response(context)
1057608
def render(object, fields, view = nil, context: Attributor::DEFAULT_ROOT_CONTEXT)
      if fields.is_a? Array
        sub_fields = fields[0]
        object.each_with_index.collect do |sub_object, i|
          sub_context = context + ["at(#{i})"]
          render(sub_object, sub_fields, view, context: sub_context)
        end
      elsif object.is_a? Praxis::Blueprint
        @cache[object.object_id][fields.object_id] ||= _render(object, fields, view, context: context)
      else
        _render(object, fields, view, context: context)
      end
    rescue SystemStackError
      raise CircularRenderingError.new(object, context)
    end
1330543
def delete_many(self, *args, **kwargs):
        
        result = self.collection.delete_many(*args, **kwargs)
        return result.raw_result
429511
def mode_collection():
    
    print globals()['mode_collection'].__doc__
    collection_node_id = existing_node_input()
    value = render_value_for_node(collection_node_id)
    if not value:
        return None
    print "Collection length: {0}".format(len(value))
    print safe_dump(value, default_flow_style=False)

    item_attr_list = []
    if len(value):
        for key in value.items()[0][1].keys():
            m = re.match(r'(.*) \((\d+)\)', key)
            item_attr_list.append(m.group(1))

    selection = True
    while selection:
        selection = select([
            'View collection',
            'Add item',
            'Add attribute',
            'Remove item',
            'Remove attribute',
            'Purge collection'
            ])
        if selection == 'View collection':
            print safe_dump(value, default_flow_style=False)
        elif selection == 'Purge collection':
            confirm = raw_input("Delete all {0} items and their {1} attributes from the collection? y/n\n".format(len(value.keys()), len(item_attr_list)))
            if confirm == 'y':
                delete_node(node_id=collection_node_id)
                purge_collection(value.keys())
        elif selection == 'Remove item':
            item_node_id = existing_node_input()
            if item_node_id < 0:
                return
            value = render_value_for_node(item_node_id)
            print safe_dump(value, default_flow_style=False)
            confirm = raw_input("Delete this node and it's attributes? y/n\n").format(len(value.keys()), len(item_attr_list))
            if confirm == 'y':
                delete_node(node_id=item_node_id)
                purge_collection(value.keys())

        elif selection == 'Add item':
            result = select_node(node_id=collection_node_id)
            collection_name = result[0].get('name')

            add_item_with_attributes_to_collection(
                    collection_name=collection_name,
                    collection_node_id=collection_node_id,
                    item_attr_list=item_attr_list)
        elif selection == 'Remove attribute':
            print "Select the attribute that will be removed:"
            attribute_selection = select(item_attr_list)
            if attribute_selection:
                confirm = raw_input("Delete attribute '{0}' from all {1} items in the collection? y/n\n".format(attribute_selection, len(value.keys())))
                if confirm == 'y':
                    for item_key, item in value.items():
                        for key in item.keys():
                            m = re.match(r'(.*) \((\d+)\)', key)
                            if m.group(1) == attribute_selection:
                                delete_node(node_id=m.group(2))
                                break
        elif selection == 'Add attribute':
            item_attr = raw_input("Add a collection item attribute name: ")
            if item_attr:
                item_index = 0
                for item_key, item in value.items():
                    item_index += 1
                    m = re.match(r'(.*) \((\d+)\)', item_key)
                    item_value = render_value_for_node(m.group(2))
                    print "item {0} of {1} items".format(item_index, len(value))
                    print safe_dump(item_value, default_flow_style=False)

                    new_attr_value = raw_input("Enter item attribute value for '{0}': ".format(item_attr))
                    # set value to none if it's an empty string
                    new_attr_value = new_attr_value if len(new_attr_value) else None
                    item_attr_node_id = insert_node(name=item_attr, value=new_attr_value)

                    insert_node_node(node_id=m.group(2), target_node_id=item_attr_node_id)
        # Update the value after each operation
        value = render_value_for_node(collection_node_id)
1076709
def delete(collection)
    each_resource_with_edit_url(collection) do |resource, edit_url|
      connection.delete(edit_url, 'If-Match' => "*")
    end
    # return count
    collection.size
  end
566303
def render_to_response(self, form, **kwargs):
        ''''''
        page = self.get_page(form)
        data = {
            'iTotalRecords': page.paginator.count,
            'iTotalDisplayRecords': page.paginator.count,
            'sEcho': form.cleaned_data['sEcho'],
            'aaData': self.get_rows(page.object_list),
        }
        return self.json_response(data)
84487
public function actionDeleteImage(): Response
    {
        $model = $this->findModel($this->attachmentModelClass, Yii::$app->request->post('id'));

        $model->delete();

        return $this->asJson([
            'status' => 'success',
        ]);
    }
188861
function render(drizzleData) {
  return Promise.all([
    renderPages(drizzleData),
    renderCollections(drizzleData)
  ]).then(
    allData => {
      return {
        data: drizzleData.data,
        pages: allData[0],
        patterns: allData[1],
        templates: drizzleData.templates,
        options: drizzleData.options,
        tree: drizzleData.tree
      };
    },
    error => DrizzleError.error(error, drizzleData.options.debug)
  );
}
540729
def delete(self, **kwargs):
        
        self.reload_context(es_based=False, **kwargs)
        return super(ESCollectionView, self).delete(**kwargs)
488890
def _delete_collection(self, **kwargs):
        
        error_message = "The request must include \"requests_params\": {\"params\": \"options=<glob pattern>\"} as kwarg"
        try:
            if kwargs['requests_params']['params'].split('=')[0] != 'options':
                raise MissingRequiredRequestsParameter(error_message)
        except KeyError:
            raise

        requests_params = self._handle_requests_params(kwargs)
        delete_uri = self._meta_data['uri']
        session = self._meta_data['bigip']._meta_data['icr_session']

        session.delete(delete_uri, **requests_params)
350348
def delete_many(self, **kwargs):
        
        db_objects = self.get_dbcollection_with_es(**kwargs)
        return self.Model._delete_many(db_objects, self.request)
1011599
def method_missing(method_name, *args, &block)
      load
      @collection.send(method_name.to_sym, *args, &block)
    end
1363441
public function renderRows()
    {
        // precache template chunks
        $this->precacheTemplate();

        // extend CompleteLister renderRows method
        parent::renderRows();

        // if we have at least one data row rendered, then remove not_found message
        if ($this->total_rows) {
            $this->template->del('not_found');
        } elseif ($this->no_records_message) {
            $this->template->del('header');
            $this->template->set('not_found_message', $this->no_records_message);
        }
    }
1165611
def view(self, sort=None, purge=False, done=None, undone=None, **kwargs):
        
        View(self.model.modify(
            sort=self._getPattern(sort),
            purge=purge,
            done=self._getDone(done, undone)
        ), **kwargs)
241102
def render(view_name, locals = {})
      view = Massimo::View.find(view_name)
      view && view.render(locals)
    end