Пример #1
0
def perform_request_job_queries(job_id, user_id, language=CFG_SITE_LANG):
    """Displays a page containing list of all
    all queries for a given job

    @param job_id: identifier of the job containing the queries
    @param user_id: identifier of the current user
    @param language: language of the page
    """
    _check_user_ownership_on_job(user_id, job_id, language)
    queries = fieldexporter_dblayer.get_job_queries(job_id)
    return fieldexporter_templates.tmpl_display_job_queries(
        job_queries=queries, job_id=job_id, language=language)
def perform_request_job_queries(job_id, user_id, language = CFG_SITE_LANG):
    """Displays a page containing list of all
    all queries for a given job

    @param job_id: identifier of the job containing the queries
    @param user_id: identifier of the current user
    @param language: language of the page
    """
    _check_user_ownership_on_job(user_id, job_id, language)
    queries = fieldexporter_dblayer.get_job_queries(job_id)
    return fieldexporter_templates.tmpl_display_job_queries(job_queries = queries,
                                                            job_id = job_id,
                                                            language = language)
    def execute_job(self, job):
        """Executes a job and returns the result of execution.

        @param job: Job object containing information about the job.

        @return: JobResult object containing the result.
        """
        job_result = fieldexporter_dblayer.JobResult(job)

        job_queries = fieldexporter_dblayer.get_job_queries(job.get_id())

        for current_query in job_queries:
            current_query_result = self.execute_query(current_query)
            job_result.add_query_result(current_query_result)

        return job_result