Beispiel #1
0
 def get_context_data(self, **kwargs):
     # print self.object, 898989
     kwargs['hosts_on'] = self.object.host_set.all()
     kwargs['hosts_off'] = set(Host.objects.all()) - set(
         kwargs['hosts_on'])  # 差集
     # kwargs['apps_on'] = self.object.app_set.all()
     # kwargs['apps_off'] = set(App.objects.all()) - set(kwargs['apps_on'])  # 差集
     return UpdateView.get_context_data(self, **kwargs)
    def get_context_data(self, **kwargs):

        # get context from django Update view
        context = UpdateView.get_context_data(self, **kwargs)

        # set form post url to current url
        context['form_url'] = self.request.path

        # return url for cancel button
        context['return_url'] = self.get_return_url()

        # set form title
        context['form_title'] = 'Update {}'.format(model_name(self.model))

        return context
Beispiel #3
0
 def get_context_data(self, **kwargs):
     context = UpdateView.get_context_data(self, **kwargs)
     context['laboratory'] = self.object.pk
     return context
Beispiel #4
0
 def get_context_data(self, **kwargs):
     context = UpdateView.get_context_data(self, **kwargs)
     context['laboratory'] = self.object.pk
     return context
Beispiel #5
0
 def get_context_data(self, **kwargs):
     context = UpdateView.get_context_data(self, **kwargs)
     context.update(self.get_admin_context())
     return context
Beispiel #6
0
 def get_context_data(self):
     context = UpdateView.get_context_data(self)
     context["devis_formset"] = DevisInlineFormset(instance=self.object)
     return context