Passed
Push — 2.x ( a55d09...a7a4bc )
by Jordi
07:04 queued 12s
created

SamplesView.__init__()   A

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nop 3
1
# -*- coding: utf-8 -*-
2
3
from bika.lims import api
4
from senaite.core.browser.samples.view import SamplesView as BaseView
5
6
7
class SamplesView(BaseView):
8
    """Samples listing inside Batches
9
    """
10
11
    def __init__(self, context, request):
12
        super(SamplesView, self).__init__(context, request)
13
        self.contentFilter = {
14
            "portal_type": "AnalysisRequest",
15
            "getBatchUID": api.get_uid(self.context),
16
            "sort_on": "created",
17
            "sort_order": "reverse",
18
            "isRootAncestor": True,  # only root ancestors
19
        }
20