Skip to content
Snippets Groups Projects
reports.py 845 B
""" Collection of controllers to build reports 

"""
from plugin_dbui import Selector


def index():
    """Main Controller handling report.

    """
    return 'Report section'


def report_1():
    """First trial
    
    """
    return "report_1"


def report_2():
    """Return the URL arguments
    
    """
    import time
    
    selector = Selector(virtdb.foo1, extfield='my_format')
    
    # user request a file with a specific format (latex,...)
    iframe = selector.download()
    if iframe:
        return iframe
    
    time.sleep(5)
    
    # standard response with the selected values
    return dict(test=selector.as_dict())


def report_3():
    """Return the URL arguments
    
    """
    selector = Selector(virtdb.harvester_selector)
    response.view = 'reports/report_2.html'
    return dict(test=selector.as_dict())