Beispiel #1
0
def deferred_resource_data(node, kw):
    values = None
    context = kw['request'].context
    resource = get_resource_model(context)
    if resource:
        order_by = methodcaller('order_by', asc(resource.title))
        job_container = get_context_or_parent(context, u'jobcontainer')
        data = get_all_data(resource, job_container, order_by=order_by)
        values = map(attrgetter('id', 'title'), data)
    return SelectWidget(values=values)
Beispiel #2
0
def view_job_container(context, request):
    resource_model = get_resource_model(context)
    jobresources = get_all_data(resource_model, context,
                        methodcaller('order_by', asc(resource_model.title)))
    jobservices = get_all_data(JobService, context,
                        methodcaller('order_by', desc(JobService.id)))
    bootstraps = get_all_data(Bootstrap, context,
                        methodcaller('order_by', desc(Bootstrap.id)))
    return {
        'api': template_api(context, request),
        'jobresources': jobresources,
        'jobservices': jobservices,
        'bootstraps': bootstraps,
    }