Esempio n. 1
0
    def _get_header_row(self):
        self.doses = DoseUnits.get_animal_units(self.kwargs.get('assessment'))

        header = []
        header.extend(Study.flat_complete_header_row())
        header.extend(models.Experiment.flat_complete_header_row())
        header.extend(models.AnimalGroup.flat_complete_header_row())
        header.extend(models.DosingRegime.flat_complete_header_row())
        header.extend(models.Endpoint.flat_complete_header_row())
        header.extend([u'doses-{}'.format(d) for d in self.doses])
        header.extend(models.EndpointGroup.flat_complete_header_row())
        return header
Esempio n. 2
0
    def _get_header_row(self):
        self.doses = DoseUnits.get_animal_units(self.kwargs.get('assessment'))

        header = []
        header.extend(Study.flat_complete_header_row())
        header.extend(models.Experiment.flat_complete_header_row())
        header.extend(models.AnimalGroup.flat_complete_header_row())
        header.extend(models.DosingRegime.flat_complete_header_row())
        header.extend(models.Endpoint.flat_complete_header_row())
        header.extend([u'doses-{}'.format(d) for d in self.doses])
        header.extend(models.EndpointGroup.flat_complete_header_row())
        return header
Esempio n. 3
0
    def get_context_data(self, **kwargs):
        context = super(UpdateView, self).get_context_data(**kwargs)
        context["crud"] = self.crud
        context["assessment"] = context["object"].get_assessment()
        context["dose_types"] = DoseUnits.json_all()

        if self.request.method == 'POST':  # send back dose-group errors
            context['dose_groups_json'] = self.request.POST['dose_groups_json']
            if hasattr(self, 'dose_groups_errors'):
                context['dose_groups_errors'] = self.dose_groups_errors
        else:
            context["dose_groups_json"] = json.dumps(
                list(self.object.doses.values('dose', 'dose_group_id', 'dose_units')))

        return context
Esempio n. 4
0
    def get_context_data(self, **kwargs):
        context = super(UpdateView, self).get_context_data(**kwargs)
        context["crud"] = self.crud
        context["assessment"] = context["object"].get_assessment()
        context["dose_types"] = DoseUnits.json_all()

        if self.request.method == 'POST':  # send back dose-group errors
            context['dose_groups_json'] = self.request.POST['dose_groups_json']
            if hasattr(self, 'dose_groups_errors'):
                context['dose_groups_errors'] = self.dose_groups_errors
        else:
            context["dose_groups_json"] = json.dumps(
                list(
                    self.object.doses.values('dose', 'dose_group_id',
                                             'dose_units')))

        return context
Esempio n. 5
0
    def get_context_data(self, **kwargs):
        context = super(CreateView, self).get_context_data(**kwargs)
        context["crud"] = self.crud
        context["experiment"] = self.experiment
        context["assessment"] = self.assessment
        context["dose_types"] = DoseUnits.json_all()

        if hasattr(self, 'form_dosing_regime'):
            context['form_dosing_regime'] = self.form_dosing_regime
        else:
            context["form_dosing_regime"] = forms.DosingRegimeForm()

        if self.request.method == 'POST':  # send back dose-group errors
            context['dose_groups_json'] = self.request.POST['dose_groups_json']
            if hasattr(self, 'dose_groups_errors'):
                context['dose_groups_errors'] = self.dose_groups_errors

        return context
Esempio n. 6
0
    def get_context_data(self, **kwargs):
        context = super(CreateView, self).get_context_data(**kwargs)
        context["crud"] = self.crud
        context["experiment"] = self.experiment
        context["assessment"] = self.assessment
        context["dose_types"] = DoseUnits.json_all()

        if hasattr(self, 'form_dosing_regime'):
            context['form_dosing_regime'] = self.form_dosing_regime
        else:
            context["form_dosing_regime"] = forms.DosingRegimeForm()

        if self.request.method == 'POST':  # send back dose-group errors
            context['dose_groups_json'] = self.request.POST['dose_groups_json']
            if hasattr(self, 'dose_groups_errors'):
                context['dose_groups_errors'] = self.dose_groups_errors

        return context
Esempio n. 7
0
 def get_context_data(self, **kwargs):
     context = super(UpdateView, self).get_context_data(**kwargs)
     context["crud"] = self.crud
     context["assessment"] = context["object"].get_assessment()
     context["dose_types"] = DoseUnits.json_all()
     return context
Esempio n. 8
0
 def get_context_data(self, **kwargs):
     context = super(UpdateView, self).get_context_data(**kwargs)
     context["crud"] = self.crud
     context["assessment"] = context["object"].get_assessment()
     context["dose_types"] = DoseUnits.json_all()
     return context