コード例 #1
0
 def get_context_data(self, **kwargs):
     context = super().get_context_data(**kwargs)
     context['usuario'] = self.request.user
     deletable_objects, model_count, protected = get_deleted_objects([self.object])
     context['deletable_objects']=deletable_objects
     context['model_count']=dict(model_count).items()
     context['protected']=protected
     return context
コード例 #2
0
 def get_context_data(self, **kwargs):
     context = super(CategoriaDelete, self).get_context_data(**kwargs)
     deletable_objects, model_count, protected = get_deleted_objects([self.object])
     #
     context['deletable_objects'] = deletable_objects
     context['model_count'] = dict(model_count).items()
     context['protected'] = protected
     return context
コード例 #3
0
    def get_context_data(self, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(**kwargs)
        # Add in a QuerySet of all the books
        context['usuario'] = self.request.user

        deletable_objects, model_count, protected = get_deleted_objects(
            [self.object])
        context['deletable_objects'] = deletable_objects
        context['model_count'] = dict(model_count).items()
        context['protected'] = protected
        return context