Esempio n. 1
0
    def get(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)

        if len(args) > 0:

            if Experiment.objects.filter(id=int(args[0])).exists():

                experiment = Experiment.objects.get(id=int(args[0]))
                if experiment.project.access == 'PU' or experiment.project.user == request.user:
                    filename = exportExperiment(experiment)

                    response = HttpResponse(open(filename, 'rb'),
                                            content_type='text/xml')
                    response[
                        'Content-Disposition'] = 'attachment; filename=' + basename(
                            filename)
                    remove(filename)

                    return response
                else:
                    raise PermissionDenied

            else:
                raise Http404("Data doesn't exists")

        redirect('experimental_data')
Esempio n. 2
0
    def get(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)

        self.load(request, *args, **kwargs)

        return TemplateView.get(self, request, *args, **kwargs)
Esempio n. 3
0
    def post(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)
        self.loadExperiments(request)

        if "action" in request.POST:

            if HasWorkingProject.isChooseProject(self, request):
                self.loadExperiments(request)

            elif request.POST['action'] == "create":
                self.newExperiment(request)

            elif request.POST['action'] == "delete":
                self.deleteExperiment(request)

            elif request.POST['action'] == "edit":
                self.editExperiment(request)

            elif request.POST['action'] == "save":
                self.saveExperiment(request)

            elif request.POST['action'] == "duplicate":
                self.duplicateExperiment(request)

        return TemplateView.get(self, request, *args, **kwargs)
Esempio n. 4
0
	def load(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)

		self.loadExperiment(request, *args)
		self.loadCondition(request, *args)
		self.loadObservations()
		self.loadTreatments()
Esempio n. 5
0
	def load(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)

		self.loadExperiment(request, *args)
		self.loadCondition(request, *args)
		self.loadObservations()
		self.loadTreatments()
Esempio n. 6
0
    def get(self, request, *args, **kwargs):

        if len(args) > 0:
            HasWorkingProject.load(self, request, *args, **kwargs)
            self.setProject(request, args[0])
            return redirect('models')

        self.load(request, *args, **kwargs)
        return TemplateView.get(self, request, *args, **kwargs)
Esempio n. 7
0
	def get(self, request, *args, **kwargs):

		if len(args) > 0:
			HasWorkingProject.load(self, request, *args, **kwargs)
			self.setProject(request, args[0])
			return redirect('models')

		self.load(request, *args, **kwargs)
		return TemplateView.get(self, request, *args, **kwargs)
Esempio n. 8
0
	def load(self, request, recompute=True, *args, **kwargs):

		# print("> Model loading")
		HasWorkingProject.load(self, request, *args, **kwargs)
		HasVariablesInSession.load(self, request, *args, **kwargs)

		self.__request = request

		self.__loadModels(request)
		self.__loadModel(request, *args)
Esempio n. 9
0
    def load(self, request, recompute=True, *args, **kwargs):

        # print("> Model loading")
        HasWorkingProject.load(self, request, *args, **kwargs)
        HasVariablesInSession.load(self, request, *args, **kwargs)

        self.__request = request

        self.__loadModels(request)
        self.__loadModel(request, *args)
Esempio n. 10
0
	def post(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)

		if (Condition.objects.filter(id=int(request.POST['id'])).exists()):

			condition = Condition.objects.get(id=int(request.POST['id']))

			self.data.update({
				'name': "" if condition.name is None else condition.name,
				'notes': "" if condition.notes is None else condition.notes
			})

		return JsonRequest.post(self, request, *args, **kwargs)
Esempio n. 11
0
	def post(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)

		if Experiment.objects.filter(project=self.project, id=int(request.POST['id'])).exists():

			experiment = Experiment.objects.get(project=self.project, id=int(request.POST['id']))

			self.data.update({
				'name': "" if experiment.name is None else experiment.name,
				'notes': "" if experiment.notes is None else experiment.notes
			})

		return JsonRequest.post(self, request, *args, **kwargs)
Esempio n. 12
0
	def post(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)

		if Treatment.objects.filter(id=int(request.POST['id'])).exists():

			treatment = Treatment.objects.get(id=int(request.POST['id']))

			self.data.update({
				'species': treatment.species,
				'time': treatment.time,
				'value': treatment.value
			})

		return JsonRequest.post(self, request, *args, **kwargs)
Esempio n. 13
0
    def post(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)

        if Treatment.objects.filter(id=int(request.POST['id'])).exists():

            treatment = Treatment.objects.get(id=int(request.POST['id']))

            self.data.update({
                'species': treatment.species,
                'time': treatment.time,
                'value': treatment.value
            })

        return JsonRequest.post(self, request, *args, **kwargs)
Esempio n. 14
0
    def post(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)

        if (Condition.objects.filter(id=int(request.POST['id'])).exists()):

            condition = Condition.objects.get(id=int(request.POST['id']))

            self.data.update({
                'name':
                "" if condition.name is None else condition.name,
                'notes':
                "" if condition.notes is None else condition.notes
            })

        return JsonRequest.post(self, request, *args, **kwargs)
Esempio n. 15
0
    def post(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)

        if Experiment.objects.filter(project=self.project,
                                     id=int(request.POST['id'])).exists():

            experiment = Experiment.objects.get(project=self.project,
                                                id=int(request.POST['id']))

            self.data.update({
                'name':
                "" if experiment.name is None else experiment.name,
                'notes':
                "" if experiment.notes is None else experiment.notes
            })

        return JsonRequest.post(self, request, *args, **kwargs)
Esempio n. 16
0
	def post(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)

		if Observation.objects.filter(id=int(request.POST['id'])).exists():

			observation = Observation.objects.get(id=int(request.POST['id']))

			self.data.update({
				'species': observation.species,
				'time': observation.time,
				'value': observation.value,
				'value': observation.value,
				'stddev': observation.stddev,
				'steady_state': 1 if observation.steady_state else 0,
				'min_steady_state': 0 if observation.min_steady_state is None else observation.min_steady_state,
				'max_steady_state': 0 if observation.max_steady_state is None else observation.max_steady_state
			})

		return JsonRequest.post(self, request, *args, **kwargs)
Esempio n. 17
0
    def post(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)

        self.load(request, *args, **kwargs)

        if "action" in request.POST:

            if HasWorkingProject.isChooseProject(self, request):
                return redirect('experimental_data')

            elif request.POST['action'] == "delete":
                self.deleteCondition(request)

            elif request.POST['action'] == "save":
                self.saveCondition(request)

            elif request.POST['action'] == "duplicate":
                self.duplicateCondition(request)

        return TemplateView.get(self, request, *args, **kwargs)
Esempio n. 18
0
	def post(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)
		self.loadExperiments(request)

		if "action" in request.POST:

			if HasWorkingProject.isChooseProject(self, request):
				self.loadExperiments(request)

			elif request.POST['action'] == "delete":
				self.deleteExperiment(request)

			elif request.POST['action'] == "save":
				self.saveExperiment(request)

			elif request.POST['action'] == "duplicate":
				self.duplicateExperiment(request)

			elif request.POST['action'] == "import":
				self.importExperiment(request)

		return TemplateView.get(self, request, *args, **kwargs)
Esempio n. 19
0
	def get(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)

		if len(args) > 0:

			if Experiment.objects.filter(id=int(args[0])).exists():

				experiment = Experiment.objects.get(id=int(args[0]))
				if experiment.project.access == 'PU' or experiment.project.user == request.user:
					filename = exportExperiment(experiment)

					response = HttpResponse(open(filename, 'rb'), content_type='text/xml')
					response['Content-Disposition'] = 'attachment; filename=' + basename(filename)
					remove(filename)

					return response
				else:
					raise PermissionDenied

			else:
				raise Http404("Data doesn't exists")

		redirect('experimental_data')
Esempio n. 20
0
	def load(self, request, *args, **kwargs):
		HasWorkingProject.load(self, request, *args, **kwargs)
		HasErrorMessages.clearErrors(self)
Esempio n. 21
0
	def get(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)
		self.loadExperiments(request)
		return TemplateView.get(self, request, *args, **kwargs)
Esempio n. 22
0
    def load(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)

        self.loadModels(request)
Esempio n. 23
0
	def load(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)
		if self.isUserLoggedIn(request):
			self.loadFolders(request)
		def load(self, request, *args, **kwargs):

			HasWorkingProject.load(self, request, *args, **kwargs)

			if self.isProjectLoaded():
				self.loadOptimization(request, *args)
 def load(self, request, *args, **kwargs):
     HasWorkingProject.load(self, request, *args, **kwargs)
     HasErrorMessages.clearErrors(self)
Esempio n. 26
0
 def load(self, request, *args, **kwargs):
     HasWorkingProject.load(self, request, *args, **kwargs)
Esempio n. 27
0
    def load(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)
        self.loadListOfSimulations()
Esempio n. 28
0
	def load(self, request, *args, **kwargs):
		HasWorkingProject.load(self, request, *args, **kwargs)
Esempio n. 29
0
    def load(self, request, *args, **kwargs):

        HasWorkingProject.load(self, request, *args, **kwargs)
        if self.isUserLoggedIn(request):
            self.loadFolders(request)
Esempio n. 30
0
	def load(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)
		self.loadListOfSimulations()
Esempio n. 31
0
	def load(self, request, *args, **kwargs):

		HasWorkingProject.load(self, request, *args, **kwargs)

		self.loadModels(request)